Page 1 of 1

JCL step execution based on sym parm value defined at job le

PostPosted: Thu Aug 28, 2014 5:01 pm
by hariharan_bk
Hi All,

I have a requirement to execute a particular step based on the value provided in symbolic parameter

We have assigned value for the symbolic parm PRODTEST as mentioned below

//XXXXXXXX JOB (x,xxx,xxxx),CLASS=A,MSGCLASS=T,REGION=0M,NOTIFY=&SYSUID
//  SET PRODTEST=T                                                                    ----> symbolic parm


Based on the parm value mentioned above (it can be either as T or P), we are supposed to execute one or the other JCL step like mentioned below.
But i m getting JCL error like this. Please help me resolve this error

STMT NO. MESSAGE
47 IEFC013I ERROR IN IF STATEMENT: T NOT VALID
54 IEFC013I ERROR IN IF STATEMENT: T NOT VALID

// IF (&PRODTEST = 'P')  THEN                               
//SUBMIT1 EXEC PGM=IEBGENER                                 
//SYSUT1 DD DISP=SHR,DSN=XXXXX.XXX.DONTUIM.JCLS(PRODUIM) 
//SYSUT2 DD SYSOUT=(B,INTRDR)                               
//SYSPRINT DD DUMMY                                         
//SYSIN DD DUMMY                                             
// ENDIF                                                     
// IF (&PRODTEST = 'T')  THEN                               
//SUBMIT2 EXEC PGM=IEBGENER                                 
//SYSUT1 DD DISP=SHR,DSN=XXXXX.XXX.DONTUIM.JCLS(TESTUIM) 
//SYSUT2 DD SYSOUT=(B,INTRDR)                               
//SYSPRINT DD DUMMY                                         
//SYSIN DD DUMMY                                             
// ENDIF                                                     


This is how JCL substitution is happening in JESJCL

47 // IF (&PRODTEST = P)  THEN                               
   IEFC653I SUBSTITUTION JCL - (T = P)                       
48 //SUBMIT1 EXEC PGM=IEBGENER                               
49 //SYSUT1 DD DISP=SHR,DSN=XXXXXX.XXXX.DONTUIM.JCLS(PRODUIM)
50 //SYSUT2 DD SYSOUT=(B,INTRDR)                             
51 //SYSPRINT DD DUMMY                                       
52 //SYSIN DD DUMMY                                           
53 // ENDIF                                                   
54 // IF (&PRODTEST = T)  THEN                               
   IEFC653I SUBSTITUTION JCL - (T = T)                       
55 //SUBMIT2 EXEC PGM=IEBGENER                               

Re: JCL step execution based on sym parm value defined at jo

PostPosted: Thu Aug 28, 2014 5:04 pm
by BillyBoyo
You need to look up IF in the JCL reference and understand what it does, rather than use it how you think it should work.

You're going to have to have "something" which takes a PARM containing the symbol, and sets a return code/condition code which you can test with your IF (0, 4, 12, for instance for one, the other, bad).