Hi Michael,

the IF THEN ELSE construct is useful to check step condition codes. You 
can for example decide weather a step should run after a previous one 
depending on its result. This is similar to the COND parameter in the EXEC 
cards. From my experiences you cannot evaluate JCL symbols. To exec batch 
depending on external conditions, I would prefer to set up an OPC/TWS 
application from the questioned job steps. Well, under certain 
circumstances I found it sufficient to generate the desired JCL with 
IEBEDIT and then submit it by IKJEFTxx or just having a small REXX-Exec as 
a kind of wrap-around. 

Cheers
Michael




Michael Knigge <michael.kni...@set-software.de> 
Gesendet von: IBM Mainframe Discussion List <IBM-MAIN@BAMA.UA.EDU>
25.06.2009 10:35
Bitte antworten an
IBM Mainframe Discussion List <IBM-MAIN@BAMA.UA.EDU>


An
IBM-MAIN@BAMA.UA.EDU
Kopie

Thema
IF-Statement in JCL






All,


is it possible to control the steps to be executed by a IF-Statement, i. 
e. with a variable?

Like this:

// SET SWITCH1=YES
// SET SWITCH2=NO
//*
//* EXECUTE ONLY IF SWITCH1 IS SET TO YES
//IF SWITCH1=YES
//STEP01  EXEC PGM=IEBGENER
//... more stuff
//ENDIF
//*
//* EXECUTE ONLY IF SWITCH2 IS SET TO YES
//IF SWITCH2=YES
//STEP02  EXEC PGM=IEBGENER
//... more stuff
//ENDIF
//*


If I've understood the JCL docs corretly there are only some predefined 
variables (like "RC") that can be checked... I wonder if there is a way...


Thanks....

Bye,
Michael

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to