by shankarhosur » Wed Oct 27, 2010 9:39 pm
//SORT020 EXEC PGM=SORT
//SYSOUT DD SYSOUT=&JCLO
//SYSPRINT DD SYSOUT=&JCLO
//SORTIN DD DSN=&HLQ1..RM.EXPANDED.AR(&GEN0),DISP=SHR
//SORTOF1 DD DSN=&HLQ1..RM.EXPANDED.AR.FILE1(&GEN1),DISP=SHR
//SORTOF2 DD DSN=&HLQ1..RM.EXPANDED.AR.FILE2(&GEN1),DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOF1,INCLUDE=((22,2,CH,EQ,C'11'),
AND,(25,1,CH,EQ,C' ',OR,26,1,CH,EQ,C' ',OR,27,1,CH,EQ,C' '),
AND,(24,4,CH,NE,C' '),
AND,(05,6,CH,EQ,C'151605'))
OUTFIL FNAMES=SORTOF2,OMIT=((22,2,CH,EQ,C'11'),
AND,(25,1,CH,EQ,C' ',OR,26,1,CH,EQ,C' ',OR,27,1,CH,EQ,C' '),
AND,(24,4,CH,NE,C' '),
AND,(05,6,CH,EQ,C'151605'))
/*
//
This is my SORT steps. I have filtered some of the records using the INCLUDE to FILE1 and rest of the records in FILE2 using the OMIT. I don’t want mention again all the condition in OMIT just to catch rest of the records because in future my INCLUDE condition may grow, in that case I need to grow my OMIT condition too…
Please suggest me…