Page 1 of 1

How get totals at bottom of the files

Posted: Tue Sep 19, 2006 4:17 pm
by mithunthakre
Hi,

I have the input with ZD values and i want the sum all the input records and diaplay the sum at bottom through JCL.

I am getting the totals for the duplicate records only but i need to get total irrespective of the data.

Anyone please help me.

Thanks,
Mit's

Posted: Tue Sep 19, 2006 9:19 pm
by Frank Yaeger
You didn't give any details, so I can only give you a general answer.

You can use a DFSORT control statement like this to get the total of your ZD fields. For the example, I assumed your ZD field is in positions 11-15.

Code: Select all

  OUTFIL REMOVECC,                                      
     TRAILER1=('TOTAL:',11:TOT=(11,5,ZD,TO=ZD,LENGTH=5)) 
The trailer record might look like this:

Code: Select all

TOTAL:    13602  
If you need more specific help, you need to give me more details such as showing the job you're using, the position and length of the ZD field, and what you want the trailer record to look like.