This is Punith. I went thru the example. This technique can be done if we know what the header and trailor records are. But in case we dont know what it is, i mean say as like dates takes place header and number of records take trailer position, how we can go about it ?
Please show a better example of what your input records look like and what you want for output. What is the RECFM and LRECL of the input file? What is the starting position, length and format of the key you want to sort on?
This is Siva. I suggest this process.Check it out.I tried and got the result.
if any doubts, reply back.
1. split the input file into 3 files using sort.
2. sort the second file and put into fourth file.
3. concatenate the first,fourth and third files using IEBGENER.
If you had bothered to look at the Smart DFSORT Trick I gave the link to before you posted, you would have seen that it shows a much more efficient way to do what you're doing - one pass rather than three passes! Or if you had bothered to read Punith's response to my post, you would have seen that he says he doesn't have "identifiers" for the header and trailer, so methods that depend on identifiers won't work. That's why I asked him for more information. I would suggest you spend a little more time reading through earlier posts before posting yourself.