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
 
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 records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
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

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