My job below works for just 1 set of records. If there is more than 1
set of records, all the header gets sorted together and then the data records. How can I sort each set of 1 and 2 records and then the next and so on?
Code:
* PUT SPECIAL KEY OF '4' IN 16 FOR DATA RECORDS.
INREC IFTHEN=(WHEN=INIT,OVERLAY=(16:C'4')),
* FOR HEADER RECORD, PUT SPECIAL KEY OF '0' IN 16.
IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),OVERLAY=(16:C'0')),
* FOR KEY1 RECORD, PUT SPECIAL KEY OF '1' IN 16.
IFTHEN=(WHEN=(2,4,CH,EQ,C'KEY1'),OVERLAY=(16:C'1')),
* FOR KEY2 RECORD, PUT SPECIAL KEY OF '2' IN 16.
IFTHEN=(WHEN=(2,4,CH,EQ,C'KEY2'),OVERLAY=(16:C'2'))
* SORT BY KEYS.
SORT FIELDS=(16,1,CH,A,2,15,CH,A)
* REMOVE SPECIAL KEY.
OUTREC FIELDS=(1,15)
/*
I get this output if there is just one set of records
If you need more specific help on this, I need to know if you want the groups sorted by the 1 record value (e.g. the 670.00 group before the 950.00 group) or in their original order (e.g. the 950.00 group before the 670.00 group). Also, do you want the KEY1 and KEY2 records to sort before the rest of the data records as implied in your job?
Actually, it would help if you would show an example of your input records with two or more groups and what you want the output records to look like. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Last edited by Frank Yaeger on Thu Sep 07, 2006 6:55 pm; edited 1 time in total
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum