Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
Sallymary wrote:
The output generated is having more than one record
But the required output is only a single record like
When we sum up all the amounts in file1 we get the total of file2
but in the former it is getting split
You specify only 10 digits for the total, so SORT is giving you the best it can without truncating the results. If your final total requires 11, maybe you should change your OUTREC.
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
Opps, forgot about the SUM field. From the DFSORT manual:
If overflow might occur during summation, INREC can be used to create a larger SUM field in the reformatted input record (perhaps resulting in a larger record for sorting or merging) so that overflow does not occur.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Sallymary,
Here's a DFSORT job that will do what you asked for. Note that we add a character 0 (C'0') before your 10 byte ZD field to make it an 11 byte ZD field so it won't overflow.