IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can IF statement use for variable or it can only use for RC?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Fri Jan 11, 2008 11:36 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
Search our Forums:

Back to Top