Seeing the way your input is i have one quick question why you want to sort only records with value "3" in 1st position. Can you tell your actual business requirement, because seeing the exisint data i dont see a reason to specifically put that condition.
but since your file is VB, you have to consider RDW.
as for the overlay part, i am not sure how to do this is the file is VB.
maybe you can overlay on the fixed portion that will always have empty entries (or filler fields)..
Joined: 06 Nov 2008 Posts: 46 Location: Manila, Philippines
I created a temporary sort key which consists of:
1. The first byte - since we need to sort ALL records by the first byte
2. A sequence number - I set this to 99 (or any fixed number) so that it WON'T be unique for records with '3' on the first byte, and SEQNUM for the rest. This will make the non '3' records unique, since we don't want the dups for these records removed.
3. The 10-byte sort key - for removing the dups.
I hope that clarified my solution. Senior SORT people would probably give a better solution.