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



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

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

Postby hariharan_bk » Thu Aug 28, 2014 5:01 pm

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                               
Many Thanks,
Harry
hariharan_bk
 
Posts: 73
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time

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

Postby BillyBoyo » Thu Aug 28, 2014 5:04 pm

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).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post