I want to sum the fields in my Input and write that value in another file with record count and the summed amount.Here we have to use only DFSORT .The Input fields are declared as S9(9)v99. I need to sum this and write it into a new file. Please find the requirements.
Required Output
Record Count = 2
Amount In Box-1 and Box-2 = 90.00(This amount should have only Box 1 and Box 2 )
Amount In Box-3 = 110.00 ( This amount should not be added into Box1 and Box2.It should be added seperatly and displayed in a different line)
***************************** Top of Data ******************************
AMOUNT IN BOX-1 = 070.00
AMOUNT IN BOX-2 = 000.00
**************************** Bottom of Data ****************************
Final Output:
Code:
***************************** Top of Data ******************************
AMOUNT IN BOX-1 AND BOX-2 = 070.00
AMOUNT IN BOX-3 =110.00
RECORD COUNT =02
**************************** Bottom of Data ****************************
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
rakeshnaredlla,
You can use a DFSORT job like the following to do what you asked for. I wasn't exactly sure where your numbers were located or what they looked like (you seem to imply they're ZD but you show decimal points in the example), so I used the most general approach (SFF). It also wasn't clear how you wanted the count and totals formatted for output, so I guessed at that too. Adjust as needed. In the future, please give complete details so people don't have to guess.