Making one variable dependent on another
You can have variables that depend on other variables or on a substring of other variables. For example, the message class and print destination might both depend on the z/OS® system that a job runs on. If you make the message class (MSGC) and destination (DEST) variables dependent on the system (SYSTEM) variable, you need only change the value of the system variable, and the others are given the correct value.
- Enter the DEP command from the MODIFYING A JCL VARIABLE panel. You see the JCL VARIABLE DEPENDENCY VALUE LIST panel, shown in EQQJVDVL - JCL variable dependency value list.
- Specify the system as the independent variable.
- For each value of the independent variable (SYSTEM), specify the
associated value of the dependent variable (MSGC). Make sure that
you specify the independent variable in the correct case, it is case-sensitive,
and
any
in EQQJVDVL - JCL variable dependency value list does not give the same result asANY
.If there are many values of SYSTEM with the same value of MSGC, make that value of MSGC the default, and do not specify those values of SYSTEM: if there is no match, MSGC takes its default value.
- When you create the JCL, make sure that the independent variable
occurs first, or the result is unpredictable.
//*%OPC SCAN //JOB6 JOB (&ACCT.,NOBO),'SAMPLE', // MSGCLASS=&MSGC.,NOTIFY=XRAYNER,CLASS=A /*JOBPARM SYSAFF=&SYSTEM. //*MAIN SYSTEM=&SYSTEM. //OUTPUT1 OUTPUT DEST=&DEST,DEFAULT=NO
In this example, the job will fail if MSGC depends on SYSTEM, because the MSGC variable occurs first.
Change the JCL by inserting a comment card before the first dependent variable:
//*%OPC SCAN //* THE VALUE OF SYSTEM IS &SYSTEM. //JOB6 JOB (&ACCT.,NOBO),'SAMPLE', // MSGCLASS=&MSGC.,NOTIFY=XRAYNER,CLASS=A /*JOBPARM SYSAFF=&SYSTEM. //*MAIN SYSTEM=&SYSTEM. //OUTPUT1 OUTPUT DEST=&DEST,DEFAULT=NO
- The SYSTEM variable is set to ZOS18P1 or ZOS18T1, depending on your JCL runs in a production or a test system.
- The input for your JCL must be TWSZ.PROD.IN or TWSZ.TEST.IN, depending on your JCL runs in a production or a test system.
Then you can reference TWSZ.&DSNQL..IN
in
your JCL and run it in both your systems.