Step 1- File A with Lrecl 1500 and huge nnumber of records is Sorted using and it produces File B (unique records) and File C (Duplicate records in Xsum) Out of 42 milloin records only 1 million is duplicates.
Step 2 - Sorts the File B (unique records) produced in step 1 by
and produces File D . Each of these steps run for 2.5 hours .
My Question is , if we ombine these 2 sort steps into one (Doing the second sort along with Xsum like one given below) , will it provide savings in elapsed time ?
So that unique records are sorted in correct order
Yes. It'll be sorted in correct order. But the records may not be unique now
OUTREC OVERLAY=(1501:SEQNUM,8,ZD,RESTART=(1,18)). The RESTART parameter here would work combining with the SORT FIELDS=(1,18,...) so that INCLUDE given in your OUTFIL FILES=01 extracts only the first record out of each key occurring at pos 1-18. Now that you have removed pos 1-18 from the sort fields, it may not be extracting 'unique' records.