Change the layout of the report in COBOL
Posted: Thu Dec 27, 2012 9:28 am
I have a task to produce a report based on the data from DB2 table. Currently, I want to have a different layout which the account number did not repeatedly appear. For example, current output:
My desired output is this:
How to compute the subtotal for each account?
Currently, I'm using this coding to add summation of all amount which produce the TOTAL:
Since I'm currently new in COBOL programming (about 1 month), I have still difficulties in doing this task.
Also, how can I automatically add the account number without the duplication? Do I need to set it manually? For example, MOVE '111111111' to W-RPT-ACC-NO.
Thank you in advance for your help.
Code'd
---------------------------------------
ACCOUNT NO. CERT AMOUNT
---------------------------------------
111111111 100.00
111111111 5,000.00
222222222 100.00
222222222 5,000.00
333333333 100.00
333333333 5,000.00
TOTAL 15,300.00
ACCOUNT NO. CERT AMOUNT
---------------------------------------
111111111 100.00
111111111 5,000.00
222222222 100.00
222222222 5,000.00
333333333 100.00
333333333 5,000.00
TOTAL 15,300.00
My desired output is this:
------------------------------------------
ACCOUNT NO. CERT AMOUNT
----------------------------------------
111111111 5,100.00
222222222 5,100.00
333333333 5,100.00
TOTAL 15,300.00
ACCOUNT NO. CERT AMOUNT
----------------------------------------
111111111 5,100.00
222222222 5,100.00
333333333 5,100.00
TOTAL 15,300.00
How to compute the subtotal for each account?
Currently, I'm using this coding to add summation of all amount which produce the TOTAL:
ADD W-CERT-AMOUNT1 TO W-TOTAL-TEMP1.
MOVE W-TOTAL-TEMP1 TO W-RPT-CERT-TOTAL.
MOVE W-TOTAL-TEMP1 TO W-RPT-CERT-TOTAL.
Since I'm currently new in COBOL programming (about 1 month), I have still difficulties in doing this task.
Also, how can I automatically add the account number without the duplication? Do I need to set it manually? For example, MOVE '111111111' to W-RPT-ACC-NO.
Thank you in advance for your help.
Code'd