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
 
IFTHEN WHEN=ANY usage?

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

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Nov 28, 2011 6:12 pm    Post subject: IFTHEN WHEN=ANY usage?
Reply with quote

Hi,

Can any one please let me know the usage of WHEN=ANY clause in the IFTHEN statement?

From the Manual --> WHEN=ANY: Used after multiple WHEN=(logexp) clauses to apply additional operation to the records if they satisfied the criteria for any of the preceding WHEN=(logexp) clauses.

I tried using when=any but the output was not as expected.

MY JCL
Code:

//STEP002  EXEC PGM=SORT,COND=(0,NE)                       
//SYSPRINT DD SYSOUT=*                                     
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
AA 01                                                     
AA 02                                                     
AA 03                                                     
AA 04                                                     
AA 05                                                     
AA 06                                                     
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(50:SEQNUM,2,ZD)),       
        IFTHEN=(WHEN=(4,2,ZD,EQ,+02),                     
                OVERLAY=(10:C'REC TYPE 2')),               
        IFTHEN=(WHEN=(4,2,ZD,EQ,+03),                     
                OVERLAY=(10:C'REC TYPE 3')),               
        IFTHEN=(WHEN=ANY,                                 
                OVERLAY=(40:C'XXX')),                     
        IFTHEN=(WHEN=NONE,                                 
                OVERLAY=(10:C'NO VALID REC'))             
/*                                                         


OUTPUT:
Code:

AA 01    NO VALID REC                            01
AA 02    REC TYPE 2                              02
AA 03    REC TYPE 3                              03
AA 04    NO VALID REC                            04
AA 05    NO VALID REC                            05
AA 06    NO VALID REC                            06


Can any one please give a sample jcl with a example of showing when=any?
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Nov 28, 2011 6:57 pm    Post subject: Reply to: IFTHEN WHEN=ANY usage?
Reply with quote

HIT=NEXT?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Mon Nov 28, 2011 7:21 pm    Post subject:
Reply with quote

HIT=NEXT is right on.
Quote:
Processing of IFTHEN clauses continues unless one of the following occurs: A WHEN=(logexp) or WHEN=ANY clause is satisfied, and HIT=NEXT is not specified
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Nov 28, 2011 7:50 pm    Post subject:
Reply with quote

Thanks Bill and Dick. It working fine now... icon_smile.gif
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 )SEL and )ENDSEL usage cvnlynn TSO/ISPF 4 Thu Jun 15, 2017 1:15 am
No new posts Need Help with : IFTHEN(WHEN=GROUP) Sumanta_89 DFSORT/ICETOOL 1 Wed Apr 19, 2017 5:23 pm
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am
No new posts How can amount of the Storage Usage b... esduman61 CICS 6 Wed Mar 09, 2016 1:19 pm
No new posts Controlling usage of resources by tasks raja1128 CICS 3 Fri Nov 06, 2015 9:53 am

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