Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program-id. Program1 as "assignment_5.Program1".
- environment division.
- input-output section.
- file-control.
- select payroll-output assign to "C:\temp\payroll-out.txt" organization is line sequential.
- data division.
- fd payroll-output.
- 01 payroll-out-record.
- 05 pic x.
- 05 emp-no-out pic x(5).
- 05 pic x(4).
- 05 emp-name-out pic x(20).
- 05 pic x(5).
- 05 territory-no-out pic x(2).
- 05 pic x(8).
- 05 office-no-out pic x(2).
- 05 pic x(10).
- 05 annual-salary-out pic $$$,$99.
- 05 pic x(5).
- 05 ssn-no-out pic xxxbxxbxxxx.
- working-storage section.
- 01 page-heading.
- 05 pic x(30) value spaces.
- 05 payroll-listing pic x(15) value "PAYROLL LISTING".
- 05 pic x(15) value spaces.
- 05 page-title pic x(5) value "PAGE ".
- 05 page-num pic 99 value zero.
- 05 pic x(3) value spaces.
- 05 c-date.
- 10 current-day pic xx/.
- 10 current-month pic xx/.
- 10 current-year pic xxxx.
- 01 temp-date.
- 05 temp-year pic xxxx.
- 05 temp-month pic xx.
- 05 temp-day pic xx.
- 01 field-titles.
- 05 emp-no-title pic x(8) value "EMP. NO.".
- 05 pic x(2) value spaces.
- 05 emp-name-title pic x(13) value "EMPLOYEE NAME".
- 05 pic x(9) value spaces.
- 05 territory-no-title pic x(8) value "TERR NO.".
- 05 pic x(2) value spaces.
- 05 office-no-title pic x(10) value "OFFICE NO.".
- 05 pic x(2) value spaces.
- 05 annual-salary-title pic x(13) value "ANNUAL SALARY".
- 05 pic x(2) value spaces.
- 05 ssn-title pic x(11) value "SOC SEC NO.".
- 01 end-flag pic x value "Y".
- 01 line-num pic 99 value zero.
- screen section.
- 01 scr1.
- 05 blank screen
- foreground-color 2.
- 05 line 1 column 5 value "EMP NO.: ".
- 05 column 20 to emp-no-out.
- 05 line 2 column 5 value "NAME: ".
- 05 column 20 to emp-name-out.
- 05 line 3 column 5 value "TERRITORY: ".
- 05 column 20 to territory-no-out.
- 05 line 4 column 5 value "OFFICE NO.: ".
- 05 column 20 to office-no-out.
- 05 line 5 column 5 value "ANN. SALARY: ".
- 05 column 20 to annual-salary-out.
- 05 line 6 column 5 value "SOCIAL SEC. NO.: ".
- 05 column 20 to ssn-no-out.
- 05 line 7 column 5 value "CONTINUE Y/N: ".
- 05 column 20 to end-flag.
- procedure division.
- 100-main.
- display scr1
- open output payroll-output
- move function current-date to temp-date
- perform 150-print-heading
- perform until end-flag = "N"
- accept scr1
- perform 200-write-record
- display scr1
- end-perform.
- close payroll-output
- goback.
- 150-print-heading.
- add 1 to page-num
- move temp-year to current-year
- move temp-month to current-month
- move temp-day to current-day
- move page-heading to payroll-out-record
- write payroll-out-record after advancing page.
- move field-titles to payroll-out-record
- write payroll-out-record after advancing 2 lines.
- move zero to line-num
- move spaces to payroll-out-record
- write payroll-out-record after advancing 1 line.
- 200-write-record.
- write payroll-out-record after advancing 1 line.
- add 1 to line-num
- if line-num > 10
- perform 150-print-heading
- end-if.
- end program Program1.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement