Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- identification division.
- program-id. assignment-2.
- environment division.
- input-output section.
- file-control.
- select account-trans assign to
- "C:\Users\Compsci\Desktop\files\account-trans.txt".
- select account-master assign to
- "C:\Users\Compsci\Desktop\files\account-master.txt".
- configuration section.
- data division.
- fd account-trans.
- 01 input-record.
- 05 acct-no-in pic x(5).
- 05 cust-name-in pic x(20).
- 05 amt1-in pic 999V99.
- 05 amt2-in pic 999V99.
- 05 discount-amt-in pic 999V99.
- fd account-master.
- 01 output-record.
- 05 acct-no-out pic x(5).
- 05 cust-name-out pic x(20).
- 05 total-out pic 9999V99.
- 05 amt-due-out pic 9999V99.
- 05 filler pic x(3).
- working-storage section.
- 01 end-flag pic x(3) value "YES".
- procedure division.
- 100-main.
- display "test"
- open input account-trans
- output account-master
- perform until end-flag = "NO"
- read account-trans
- at end
- move "NO" to end-flag
- not at end
- perform 150-calculation
- end-read
- end-perform.
- close account-trans
- account-master
- goback.
- 150-calculation.
- display acct-no-in
- move spaces to output-record
- move acct-no-in to acct-no-out
- move cust-name-in to cust-name-out
- add amt1-in to amt2-in giving total-out
- subtract discount-amt-in from total-out giving
- amt-due-out
- write output-record after advancing 1 line.
- end program assignment-2.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement