I have set FLAG as 1 and I am execpting ARG value should be DEV only. But am getting as ARG= DEV + CLIENTID
000023 // FLAG=1
000026 // IF (&FLAG=1) THEN
000027 //SET1 SET ARG=DEV
000028 // ELSE
000029 //SET2 SET ARG=DEV+&CLIENT
000030 // ENDIF
It mean JCL assign the value in RUNTIME (before checking the IF Condition).
Please help me to understand.
Thanks! Bharathi
What @hogstrom said is correct. The JCL IF statement tests Step Return codes
and not Variable values:
//IFBAD IF (ABEND | STEP1.RC > 8) THEN
Following on from what he said you can use a variable in an include
statement
// INCLUDE MEMBER=OPT&FLAG
and setup members in the proclib
// SET ARG=DEV
// SET ARG=DEV+&CLIENT
You have to setup an include for every possible value of &FLAG and it is very long winded for one SET
. It is more commonly used when you can set lots of variables like:
// INCLUDE MEMBER=ENV&ENV
where &ENV=PROD
\ TEST
etc
Do not use flag, just set the variable:
// SET ARG=DEV
or
// SET ARG=DEV+&CLIENT