filter some records



Help for IBM's record-oriented filesystem VSAM, ESDS, KSDS, RRDS, LDS and Storage management Subsystems

filter some records

Postby shankarhosur » Wed Oct 27, 2010 9:01 am

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..
shankarhosur
 
Posts: 10
Joined: Sat Oct 16, 2010 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: filter some records

Postby dick scherrer » Wed Oct 27, 2010 9:16 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: filter some records

Postby 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…
shankarhosur
 
Posts: 10
Joined: Sat Oct 16, 2010 6:10 am
Has thanked: 0 time
Been thanked: 0 time

Re: filter some records

Postby Frank Yaeger » Wed Oct 27, 2010 10:08 pm

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
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to VSAM/SMS

 


  • Related topics
    Replies
    Views
    Last post