Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
You are kidding, right?
Have you looked at your manual?
SyncSort for z/OS 1.3 Programmer’s Guide wrote:
SUM Control Statement
The SUM control statement deletes records with equal control fields and optionally sums specified numeric fields on those records. Equal keyed records are processed pair by pair. If numeric fields are to be summed, the data in the summed fields are added, the sum is placed in one of the records, and the other record is deleted.
Joined: 01 Sep 2006 Posts: 39 Location: Chennai, India
Hi Rahul,
You can give the following in case of two fields (assuming your second field starts from 11th Position and length 8):
SORT FIELDS=(1,08,CH,A,11,8,CH,A)
If you have three fields then append the third column at the end.
But still if you want the exact SORT, please provide the starting poistion, length and datatype of the three columns which is to be the key.
Hi Dick
I tried that considering the amount column as string as mentioned by Enricho. But I never thought of the case pointed by you. I never thought that whatever Rahul has requested is for summing up fields. I thought it was just string manipulations based on the key.
Finally, You were correct in understanding Rahul's question intially. I hope that's because of your experience. Soon, I will also learn from you people in understanding the questions.
Thanks Ram & CICS guy, your suggestions too worked fine. Also the sort card used by me also worked. I used acctnum,ccy and product as the key. I modified the file to have key in the front and then I used following sort card to get the desired output.