We have an input file of over 8000 characters. Out of this, we have a field of length 7980 which needs to be sorted before processing.
But we came to know that sort is capable of handling at a maximum of 4092 characters, irrespective of the length of the record.
Can anyone please suggest us an alternate way to get this sort done?
Joined: 18 Jul 2007 Posts: 2150 Location: At my coffee table
If you can fit the total number of records into the max size of a seqnum, sort it several times, first with the first 4092 bytes of the key while appending a seqnum, then again with the seqnum and the rest of the key.....
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
One way to do what you want is to sort the file 2 times.
The first sort is on positions 4001-8000.
The second sort (using the output from the first sort) is on positons 1-4000. In this second sort, specify OPTION EQUALS to preserve the original sequence of the records within the new sort key. If EQUALS is in effect, the duplicate records are kept in their original order.