Page 1 of 1

filter some records

PostPosted: Wed Oct 27, 2010 9:01 am
by shankarhosur
I am using SORT program.
I want to filter some records in the file. For that I have some conditions in INCLUDE COND. rest of the record i blindly want catch in some other file. I dont want to mention the conditions whatever i have mentioned in the INCLUDE COND again in OMIT COND.
PLZ SUGGEST ME..

Re: filter some records

PostPosted: Wed Oct 27, 2010 9:16 am
by dick scherrer
Hello,

When you have a new question, you should start a new topic.

Which sort (and preferably which release) is being used on your system? This new topic is not in either of the sort parts of the forum but can be moved later.

Post the jcl and control statements you have thus far.

Re: filter some records

PostPosted: Wed Oct 27, 2010 9:39 pm
by shankarhosur
//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…

Re: filter some records

PostPosted: Wed Oct 27, 2010 10:08 pm
by Frank Yaeger
You can use DFSORT's SAVE parameter for that:

   OUTFIL FNAMES=SORTOF2,SAVE


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080