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: 4648
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 Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am


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