Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- identification division.
- program-id. Program1.
- environment division.
- input-output Section.
- File-Control.
- Select PayRoll-Master assign to
- "E:\cobol\masterPay.txt"
- Organization is line sequential.
- Select Ind-File assign to
- "E:\cobol\indexedFile.txt"
- Organization is indexed
- ACCESS IS SEQUENTIAL
- RECORD KEY IS emp-num-out.
- configuration section.
- data division.
- file section.
- FD PayRoll-Master.
- 01 Emp-Rec.
- 05 numE pic 9(5).
- 05 cusname pic x(20).
- 05 DOP pic x(8).
- 05 amt-due pic 9999v99.
- fd Ind-File.
- 01 emp-Out.
- 05 emp-num-out pic 99999.
- 05 cus-name-out pic x(20).
- 05 DOP-out pic x(8).
- 05 amt-due-out pic 9999v99.
- working-storage section.
- 01 eof pic xxx value 'NO'.
- procedure division.
- 100-main.
- OPEN INPUT PayRoll-Master
- OUTPUT ind-file
- Perform until eof = 'YES'
- read PayRoll-Master
- at end
- move 'YES' to eof
- not at end
- perform 200-ReadFile
- end-read
- end-perform
- close PayRoll-Master
- ind-file
- goback.
- 200-ReadFile.
- Display numE
- Display cusname
- Display DOP
- Display amt-due
- Move numE to emp-num-out
- Move cusname to cus-name-out
- Move DOP to DOP-out
- Move amt-due to amt-due-out
- write emp-out
- invalid key Display "Nope"
- not invalid key Display "Yes"
- end-write
- end program Program1.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement