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

Override for "IF" statemnt from JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Tue Mar 23, 2010 3:53 pm
Reply with quote

Hi ,

I have the following step in a Proc

//IF02 IF (RC LE 4 AND ABEND=FALSE) THEN

execute some steps

//els ELSE
execute some steps

//ends ENDIF


Lets say my Jcl i XXX and my Proc name is YYY

Can i overrid my If statement from the jcl to say
IF (RC LE 8 AND ABEND=FALSE) THEN

Please Advice .
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 23, 2010 4:06 pm
Reply with quote

What is wrong with trying it yourself and then asking if you have problems.
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Tue Mar 23, 2010 4:17 pm
Reply with quote

i Actually tried a few

ex : Jobname.Stepname new condition

Procname.Stepname new condition


Nothing worked


i know how to override CONDS and DSNs , but this i am not sure how to do
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 23, 2010 4:53 pm
Reply with quote

Not sure that you can override IF/THEN/ELSE if it is in a PROC
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Mar 23, 2010 9:05 pm
Reply with quote

Hello,

Quote:
Not sure that you can override IF/THEN/ELSE if it is in a PROC
As far as i know, this cannot be overridden. . .
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 23, 2010 9:06 pm
Reply with quote

Which is why I NEVER use them within a PROC.

This is probably yet another case of bad planning / lack of testing.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Mar 23, 2010 9:48 pm
Reply with quote

What I have done to make this work in a PROC is make the condition on the IF statement a Symbolic.

The default is set in the Proc, and it can be overriden from the Job. This works really nice. It just requires you plan ahead.

Here is an example (just a snippet):
Code:

//DPPROC   PROC CA7CARD='',
//           CHKVAL='EQ 0'
......
//IFCRD      IF CHKCARD.RC &CHKVAL THEN
.....



To Override from Job to bypass step:
Code:

//CHKBND5    EXEC DPPROC,
//           CA7CARD='021',
//           CHKVAL='LT 0'
Back to top
View user's profile Send private message
mtaylor

Active User


Joined: 20 Feb 2009
Posts: 108
Location: Kansas City

PostPosted: Wed Mar 24, 2010 6:00 pm
Reply with quote

I couldn't remember if I included this in the JCL parser I wrote but symbolic replacement in IF statement is supported with the following caveat (JCL Ref 17-9). This is from the 390 version, I find it much more informative than the ZOS version (apparently someone decided to edit out or obfuscate a lot of useful information in the ZOS version of the JCL Reference).

Quote:
You can specify symbolic parameters on IF/THEN/ELSE/ENDIF statements
provided that they resolve to one of the supported relational-expression
keywords listed in the preceding topic (that is, RC, ABEND, ...). Any other
symbolic parameters, even if accepted by the system, are not intended or
supported.
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 PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
No new posts Using PARM=('JPn"&SYMBOL&quo... DFSORT/ICETOOL 2
No new posts Syncsort "Y2C" Function SYNCSORT 1
Search our Forums:

Back to Top