Tim Hare on IBM Mainframe Discussion List <IBM-MAIN@bama.ua.edu> wrote on 05/24/2010 12:18:56 PM: > Example input, RECFM=FB,LRECL=14: > > DSK001 1009999 > DSK002 3962002 > DSK003 0001001 > DSK005 2009999 > DSK006 2009999 > DSK008 0100000 > DSK007 0001002 > DSK004 0527192 > > Two fields: VOLSER in 1-6 and SIZE in 8-14. > > I want to assign a 'sequence' number to the input from 1 to 4, so that I can > sort these into 4 groups, and within those groups descending order by size: > > So for this group the input would be modified to have the sequence in 16 (for > example) resulting in a temporary work dataset of LRECL=16: > > DSK001 1009999 1 > DSK002 3962002 2 > DSK003 0001001 3 > DSK005 2009999 4 > DSK006 2009999 1 > DSK008 0100000 2 > DSK007 0001002 3 > DSK004 0527192 4 > > And the final output would be RECFM=FB,LRECL=14 > DSK006 2009999 > DSK001 1009999 > DSK002 3962002 > DSK008 0100000 > DSK007 0001002 > DSK003 0001001 > DSK005 2009999 > DSK004 0527192 > > The idea is to "balance" disk backup jobs by spreading the large volumes > across the (4) jobs evenly. Doing the sort this way isn't "perfect"but it's > closer > to what is needed.
Tim, I believe these DFSORT control statements will give you what you want: INREC IFTHEN=(WHEN=GROUP,RECORDS=4,PUSH=(16:SEQ=1)) SORT FIELDS=(16,1,CH,A,1,6,CH,A,8,7,CH,D) OUTREC BUILD=(1,14) Frank Yaeger - DFSORT Development Team (IBM) - yae...@us.ibm.com Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/ ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html