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 IF statement use for variable or it can only use for RC?

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

New User


Joined: 26 Jul 2006
Posts: 24

PostPosted: Fri Jan 11, 2008 9:59 am    Post subject: Can IF statement use for variable or it can only use for RC?
Reply with quote

Hi I need help!

I want to use one JCL instead of 2 JCL to run 2 different steps. For example, step 1 to 5 are same for 2 JCLs but step 6 is different among the 2 JCLs. So instead of using 2 JCL, I want to use IF statement for step 6. such as

// set Company = variable;
//Step6 IF ( &Company EQ 1 ) Then
//co1 Exec Proc 1
// ELSE
//co2 Exec Proc 2
//end ENDIF

I find when variable is 1, then Proc 1 is executed, but when variable is not 1, then both Proc 1 and Proc 2 are executed????


But if I replace the &Company with RC, then it works fine. In my case, I am not checking the reture code. I am checking a variable which I pass into the JCL?

Will JCL IF statement work fine for variable or it can only work with RC?

Thanks for your time!
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4649
Location: Raleigh, NC, USA

PostPosted: Fri Jan 11, 2008 11:36 am    Post subject: Re: Can IF statement use for variable or it can only use for
Reply with quote

atanwc wrote:
Will JCL IF statement work fine for variable or it can only work with RC?


It can only work with RC or ABEND or ABENDCC or RUN. See here for more details.
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 ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


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