Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- identification division.
- program-id. Program1.
- environment division.
- input-output section.
- select payroll-master assign to "C:\temp\pay-master.txt"
- organization is line sequential.
- select sorted-payroll-master assign to
- "C:\temp\sorted-master.txt" organization is line sequential.
- select sort-file assign to "C:\temp\sort-file.txt".
- configuration section.
- data division.
- fd payroll-master.
- 01 master-rec.
- 05 pic x(25).
- 05 m-territory pic x(2).
- 05 m-office pic x(2).
- 05 pic x(6).
- 05 m-ssn pic x(9).
- 05 pic x(36).
- fd sorted-payroll-master.
- 01 out-rec pic x(80).
- sd sort-file.
- 01 sort-rec.
- 05 pic x(25).
- 05 s-territory pic x(2).
- 05 s-office pic x(2).
- 05 pic x(51).
- working-storage section.
- 01 eof pic x value 'N'.
- procedure division.
- 100-main.
- sort sort-file
- on descending key s-territory
- on descending key s-office
- input procedure 200-select
- giving sorted-payroll-master
- goback.
- 200-select.
- open input payroll-master
- perform until eof = 'Y'
- read payroll-master
- at end move 'Y' to eof
- not at end perform 300-choose
- end-read
- end-perform
- close payroll-master.
- 300-choose.
- if m-territory = spaces or m-office = spaces
- or m-ssn = spaces
- display master-rec
- else
- move master-rec to sort-rec
- release sort-rec
- end-if.
- end program Program1.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement