Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Syncsort - Can my SORT include an exclusion criteria?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
shilpa.khaire

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Fri Aug 28, 2009 12:07 am    Post subject: Syncsort - Can my SORT include an exclusion criteria?
Reply with quote

Hi all!

I have a SORT step which works exactly as expected(given below).
Code:

  INREC IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,(264,2,CH,EQ,C'11',OR,     
              264,2,CH,EQ,C'12')),                                   
               BUILD=(1,130,131:C'ABCDEF',137,127,264:C'  ',266,15)),
      IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,(264,2,CH,NE,C'11',AND,   
              264,2,CH,NE,C'12')),                                   
               BUILD=(1,130,131:C'UVWXYZ',137,127,264:C'  ',266,15)),
      IFTHEN=(WHEN=(21,3,CH,EQ,C'599',AND,24,9,ZD,EQ,0),             
                BUILD=(1,130,131:C'A',137,127,264:C'  ',266,15)),
      IFTHEN=(WHEN=(21,3,CH,EQ,C'120',AND,(58,3,CH,EQ,C'142',OR,     
              58,3,CH,EQ,C'152',OR,58,3,CH,EQ,C'181',OR,             
              58,3,CH,EQ,C'185',OR,58,3,CH,EQ,C'191',OR,             
              58,3,CH,EQ,C'194',OR,58,3,CH,EQ,C'195',OR,             
              58,3,CH,EQ,C'196')),                                   
               BUILD=(1,130,131:C'ABCDEF',137,127,264:C'  ',266,15))
  OUTFIL FNAMES=MATCH,                                                 
             INCLUDE=(131,6,CH,EQ,C'ABCDEF',OR,131,6,CH,EQ,C'UVWXYZ')
  OUTFIL FNAMES=UNMATCH,SAVE                                           
  SORT FIELDS=(24,9,ZD,A)                                             
  END                                                                 

Now I need to add an exclusion criteria to it. Given below is my exclusion criteria. My question here is , instead of having a separate SORT step for this exclusion, can I merge it with the above SORT step? If yes, how? I need this exclusion right at the beginning beacuse this has highre prefernce over the other selection criteria.
Basically, here I want to exclude all the records which have the following values at postion 58:'142', '152', '181', '185', '191', '194', '195',
or '196'.
Code:

  SORT FIELDS=Copy
  OMIT COND=(58,3,CH,EQ,C'142',OR,58,3,CH,EQ,C'152',OR,
                58,3,CH,EQ,C'181',OR,58,3,CH,EQ,C'185',OR,
                58,3,CH,EQ,C'191',OR,58,3,CH,EQ,C'194',OR,
                58,3,CH,EQ,C'195',OR,58,3,CH,EQ,C'196')                                     


Thanks
Shilpa
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Aug 28, 2009 1:16 am    Post subject:
Reply with quote

Yes, you can add the OMIT statement to the first SORT step. An OMIT statement is processed before an INREC statement so the records will be omitted first.

See this Figure for the order of processing of DFSORT control statements:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA40/FIGSTMTSEQ?SHELF=&DT=20090527161936&CASE=&ScrollTOP=FIGSTMTSEQ#FIGSTMTSEQ

Note that a simpler way to code the OMIT statement would be:

Code:

  OMIT COND=(58,3,SS,EQ,
   C'142,152,181,185,191,194,195,196')


Note also that if you use either OMIT statement, your fourth IFTHEN clause will never be true since all of the records that could satisfy it will be deleted before INREC processing.
Back to top
View user's profile Send private message
shilpa.khaire

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Fri Aug 28, 2009 6:30 am    Post subject:
Reply with quote

I forgot to mention that I am using SYNCSORT.
I tried using the OMIT condition as below but I am getting a syntax error and a duplicate statement error.
Code:

OMIT COND=(58,3,SS,EQ,                                               
   C'142,152,181,185,191,194,195,196')                               
INREC IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,(264,2,CH,EQ,C'11',OR,     
              264,2,CH,EQ,C'12')),                                   
               BUILD=(1,130,131:C'ABCDEF',137,127,264:C'  ',266,15)),
      IFTHEN=(WHEN=(21,3,CH,EQ,C'393',AND,(264,2,CH,NE,C'11',AND,     
              264,2,CH,NE,C'12')),                                   
               BUILD=(1,130,131:C'GHIJKL',137,127,264:C'  ',266,15)),
      IFTHEN=(WHEN=(21,3,CH,EQ,C'599',AND,24,9,ZD,EQ,0),             
               BUILD=(1,130,131:C'ABCDEF',137,127,264:C'  ',266,15)),
OUTFIL FNAMES=MATCH,                                                 
             INCLUDE=(131,6,CH,EQ,C'ABCDEF',OR,131,6,CH,EQ,C'GHIJKL')
OUTFIL FNAMES=UNMATCH,SAVE                                           
SORT FIELDS=(24,9,ZD,A)                                               
END                                                                   


The error is as below:
Code:

 OUTFIL FNAMES=MATCH,                                                 
              INCLUDE=(131,6,CH,EQ,C'ABCDEF',OR,131,6,CH,EQ,C'GHIJKL')
              *                                                       
 OUTFIL FNAMES=UNMATCH,SAVE                                           
 SORT FIELDS=(24,9,ZD,A)                                             
 END                                                                 
WER268A  INREC STATEMENT   : SYNTAX ERROR                             
WER269A  OMIT STATEMENT    : DUPLICATE STATEMENT FOUND               
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                         
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                         


Please help me with this error!

Thanks![/quote]
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Aug 28, 2009 7:55 am    Post subject:
Reply with quote

Hi,

try removing the comma at the end of this statement before the first OUTFIL statement
Code:
               BUILD=(1,130,131:C'ABCDEF',137,127,264:C'  ',266,15)),



Gerry
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts More than 1 Include criteria for sing... Roy Ware SYNCSORT 6 Wed Sep 13, 2017 11:45 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us