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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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