Posted: Wed Feb 14, 2007 2:40 am Post subject: Sort in a specified sequence of values of one field
Hello,
I am just wondering if the below requirement can be done through Syncsort (I have SYNCSORT FOR Z/OS 1.2.2.3N in my shop).
Input file - LRECL - 150, RECFM - FB
Code:
Field Pos Data Type
----- --- ----------
Acct No 1-8 Char ( 8 )
Activity 9-12 Char ( 4 )
Date 23-30(YYYYMMDD) Char ( 8 )
Sort criteria :
The Acct No and Date would be ascending order.
Also, the file should be sorted in such a way that for every unique combination of Acct No and Date, the Activity should appear in the below mentioned order.
On a single day, any one or more than one of the Activity may appear for one Acct No in th e input file. There are several other Activity codes, which should appear in ascending order.
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Wed Feb 14, 2007 6:24 am Post subject:
Quote:
The Acct No and Date would be ascending order.
Pranabesh,
Your Output does NOT match the specs. If you want ascending acctno and date seq the acct no 17734567 will be the first record instead of 18856735. Do you want the output to be sorted first on date and then on the Acct no?
Any way try these untested sort control cards which will give you the results. For all the possible activity sequence assign a variable at the end(151) and sort on it along with acctno and date to get the records in the sequence. While writing out to the output we remove the assigned sequence
Sorry Kolusu, while writing the output example I mentioned the wrong order by mistake. You are right, and the solution worked great!!
Thanks a lot, Kolusu!
One more question. There are several other Activity types e.g. 1439, 6500,0017, 5001.
Can you please let me know how the sort card be changed so that all other Activity types would come after the Activity types I have provided initially, i.e. without overlaying with unique characters for each of the other Activity types,
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum