Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- identification division.
- program-id. assignment-1-files.
- environment division.
- input-output section.
- file-control. select sales-data assign to
- "C:\temp\sales-data.txt".
- select com-data assign to "C:\temp\com-data.txt".
- configuration section.
- data division.
- fd sales-data.
- 01 sales-record.
- 05 sales-name pic x(20).
- 05 sales-amount pic 999V999.
- fd com-data.
- 01 com-record.
- 05 pic x(5).
- 05 name-out pic x(20).
- 05 pic x(15).
- 05 com-out pic 9999999.99.
- working-storage section.
- 01 end-flag pic x(3) value "YES".
- 01 final-commission pic 99.99.
- procedure division.
- 100-main.
- open input sales-data
- output com-data
- perform until end-flag = "NO"
- read sales-data
- at end
- move "NO" to end-flag
- not at end
- perform 150-calculation
- end-read
- end-perform.
- close sales-data
- com-data
- goback.
- 150-calculation.
- move sales-name to name-out
- multiply sales-amount by 0.12 giving final-commission
- move final-commission to com-out
- write com-record after advancing 1 line.
- end program assignment-1-files.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement