Variable substitution in z/OS JCL procedures
Variable substitution does not take place within JCL procedures. If you have z/OS® JCL variables within such procedures, their substitution is independent of any substitution made by IBM Tivoli Workload Scheduler for z/OS. Even if the z/OS JCL variable name is the same as an IBM Tivoli Workload Scheduler for z/OS variable name, the values assigned to the two variables will be unrelated. However, if you want the variable reference outside the procedure to be substituted by z/OS, you can define the IBM Tivoli Workload Scheduler for z/OS-variable with the attribute DEF=␢ (value not required). with the attribute DEF=blank (value not required).
If a variable is given a value of ␢ (blank), the If a variable is given a value of blank, the variable will not be substituted if the variable definition states that no value is required. This lets these variables undergo normal JCL substitution after the tailoring performed by IBM Tivoli Workload Scheduler for z/OS. If a variable is given a default value of ¬ (logical not), the variable is deleted from the line.
This means that z/OS substitutes the variables that have a ␢, or not-required, value. IBM Tivoli Workload Scheduler for z/OS substitutes the variables that have values that are not blanks, as well as variables that require values.
This means that MVS™ substitutes the variables that have a blank, or not-required, value. IBM Tivoli Workload Scheduler for z/OS substitutes the variables that have values that are not blanks, as well as variables that require values.
Because procedures are called after IBM Tivoli Workload Scheduler for z/OS substitution has taken place, a situation in which a procedure variable is assigned a IBM Tivoli Workload Scheduler for z/OS variable value can occur. Consider the JCL in Figure 1 and the procedure in Figure 2.
//EXEC PROC=MYPROC
//DD2 DD DSN=MY.&DS2,DISP=SHR
//EXEC PROC=MYPROC
//DD2 DD DSN=MY.&DS2,DISP=SHR
If DS2 is defined as a IBM Tivoli Workload Scheduler for z/OS variable, it is substituted in the usual way.
//MYPROC EXEC PGM=IKJEFT01,DYNAMNBR=50,REGION=4096K
//DD2 DD DSN=MY.&DS2,DISP=SHR
//MYPROC EXEC PGM=IKJEFT01,DYNAMNBR=50,REGION=4096K
//DD2 DD DSN=MY.&DS2,DISP=SHR
//DD2 DD DSN=MY.&DS2,DISP=SHR
Any value that the variable DS2 is assigned within the procedure is not substituted in this line because, as far as z/OS is concerned, the variable DS2 does not occur. If you want the variable to take the value assigned by the procedure rather than the IBM Tivoli Workload Scheduler for z/OS value, you can give the variable a default value of ␢ (blank) and set the VALUE REQUIRED attribute to ‘N’ in the IBM Tivoli Workload Scheduler for z/OS database using the JCL VARIABLE DEFINITION panel. This causes IBM Tivoli Workload Scheduler for z/OS to ignore the variable when performing variable substitution.