Thanks for your reply . Instead of having 2 sort steps (first step for formatting & the next step to sort on key field & remove duplicates ) , i would like to have one sort control card
Please let me know while formatting the file , Is it possible to sort the file on key fields as mentioned by Kolusu in the above example.?
When i add sort control card for sorting & eliminating the duplicates to the existing control statements, the output is not being shown in sorted order .
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
suyerasi,
*Sigh* The above code shown by me DOES remove the duplicates. Did you code it as is? The sort fields is at pos 5 instead of pos 1. Did you notice that? or are you still using the old sort card?
Since the key of the above records is alphabetic, the sorted output should show these records in the beginning of the output . But in my output they are being shown at the end .
8 SOCIETE CAPT
BLOAN BANK LOANS/DEBT
GNMA GAPA GENERATOR
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
suyerasi,
You are one talking about a completely different issue. Your first question was about removing duplicates. Was that resolved?
You never mentioned that you have Alpha-numeric data till now. The first posts show that you have all numeric data and we showed a sort card using UFF format to get what you want.
You need to explain all your rules clearly and show sample input and desired output.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
suyerasi,
UFF treats an all alphabetic field as 0 so the alphabetic fields would sort before the numeric fields.
You can't use UFF to sort both numeric and alphabetic fields. Instead we can identify the numeric fields, insert leading zeros in them, and then sort them along with the alphabetics using CH. It's a bit tricky but you can use these DFSORT control statements to do what you asked for: