My requirement is to get a formatted report having subtotal regionwise and a grand total. I am just giving an example. All the file are FB and record length of 700.
suppose, following is my two input file,
101 xxxxxxxxxxx
101 xxxxxxxxxxx
102 xxxxxxxxxxx
103 xxxxxxxxxxx
103 xxxxxxxxxxx
104 xxxxxxxxxxx
105 xxxxxxxxxxx
it should display like this
----------------------------------
SUB TOTAL 719.00
----------------------------------
101 xxxxxxxxxxx
----------------------------------
SUB TOTAL 101.00
----------------------------------
----------------------------------
TOTAL 820.00
----------------------------------
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can do this kind of thing with the report functions of DFSORT's OUTFIL statement, but exactly what you would code depends on exactly what the input looks like and exactly what you want the report to look like.
If you want me to show you how to do what you ant, please give a more detailed example of your input records and exactly what you want the output records/report to look like. Indicate the starting position, length and format of each relevent field (key, amount to be totalled, etc).