After a long time I am back to mainframe again.. :)
I got a requirement recently which I don’t know how to do that through sort parm. So need your help.
Here is the detail of the requirement:
1. We are matching two files based on a key, in a program and giving an o/p file which has the fields--> Key, Amount and the Indicator(Matched & Unmatched).
2. In the next step we are using Report Sort parm to generate a report. The requirements of that report are:
a. The TRAILER should have a Total field having the sum of all the amount for that key and an UNMATCHED Total field which should have the sum amount of unmatched records for that key.
Well, your totals don't really seem to add up to what's in your data, but I think I get the idea. You can use a DFSORT job like the following. Just adjust everything for your actual input fields and expected output. The trick is to use IFTHEN to put 16-23 in 80-87 for the 'UM' records and PD 0's in 80-87 for the other records, and then do a TOT on 80-87 to get the total for the 'UM' records.