Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Can we use 2 include stmts in a sort

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

New User


Joined: 21 Mar 2007
Posts: 26
Location: kerala

PostPosted: Fri Mar 23, 2007 12:58 pm    Post subject: Can we use 2 include stmts in a sort
Reply with quote

hi,

Code:


//SORT1 JOB NOTIFY=&SYSUID                       
//S1 EXEC PGM=SORT                               
//SYSPRINT DD SYSOUT=*                           
//SYSOUT DD SYSOUT=*                             
//SORTIN DD DSN=ESCUB11.SARATH.FE11,DISP=SHR     
//SORTOUT DD DSN=ESCUB11.SARATH.FEOUT,DISP=SHR   
//SYSIN DD *                                     
        SORT FIELDS=(1,10,CH,A)                   
        SUM FIELDS=NONE                           
                                                 
        INCLUDE COND=(1,2,CH,EQ,C'SA')           
        INCLUDE COND=(13,2,CH,EQ,C'AB')           
/*                                               
//                                               


cam we use 2 include stmts in a sort
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Mar 23, 2007 1:32 pm    Post subject:
Reply with quote

Only one Include statement is allowed. You can use either OR or AND for more than one condition like


INCLUDE COND=(1,2,CH,EQ,C'SA',OR,
13,2,CH,EQ,C'AB')


INCLUDE COND=(1,2,CH,EQ,C'SA',AND,
13,2,CH,EQ,C'AB')
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Mar 23, 2007 1:32 pm    Post subject:
Reply with quote

I know you can use multiple conditions, but they need to be in the same include cond= statement seperated by an "or".
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 Mar 23, 2007 9:14 pm    Post subject:
Reply with quote

achu,

You can only have one INCLUDE statement, but you can also have an OUTFIL statement with an INCLUDE operand:

Code:

    INCLUDE COND=(1,2,CH,EQ,C'SA') 
    SORT FIELDS=(1,10,CH,A)                   
    SUM FIELDS=NONE           
    OUTFIL INCLUDE=(13,2,CH,EQ,C'AB') 


However, note that the INCLUDE statement removes records before SORT and SUM whereas the OUTFIL statement removes records after SORT and SUM. So this might or might not do what you want. And as mentioned by others, an INCLUDE statement with AND or OR might do what you want.

If that doesn't help, then tell us what you're trying to do and show an example of your input records and what you want for output.
Back to top
View user's profile Send private message
achusarath

New User


Joined: 21 Mar 2007
Posts: 26
Location: kerala

PostPosted: Mon Mar 26, 2007 12:17 pm    Post subject: Re: Can we use 2 include stmts in a sort
Reply with quote

HI SIR,

thank u
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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us