taciturnanthem
2008-11-06 13:11:20 UTC
The question presents itself as: "Write a program to print all information from payroll records for employees of the International Cherry Machine Company (ICM)."
My code is as follows (there is a separate file that is called C0402):
IDENTIFICATION DIVISION.
PROGRAM-ID. PAYROLL-MASTER.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT C0402 ASSIGN TO DATA4E.
*
DATA DIVISION.
FILE SECTION.
FD C0402.
01 PAYROLL-MASTER.
05 IN-EMPLOYEE-NO. PIC X(5).
05 IN-EMPLOYEE-NAME. PIC X(20)
100-MAIN-MODULE.
OPEN INPUT C0402
OUTPUT OUT-SAMPLE
PERFORM UNTIL ARE-THERE-MORE-RECORDS = 'NO'
READ IN-EMPLOYEE-FILE
AT END
MOVE 'NO' TO ARE-THERE-MORE-RECORDS
NOT AT END
PERFORM 200-PROCESS-RTN
END-READ
END-PERFORM
CLOSE IN-EMPLOYEE-FILE
OUT-SALARY-FILE
STOP RUN.
200-PROCESS-RTN.
MOVE C0402 TO
MOVE C0402 TO
WRITE