IBM Support

Set a JCL VARIABLE in one job and pass it to another.

Troubleshooting


Problem

It may be desirable to set a JCL variable in one job, then pass that same variable to several other jobs. For instance, a user may be prompted for a TAPE VOLSER which is to be used in several related jobs.

Resolving The Problem

Need:

Several TWSz-scheduled jobs access the same tape VOLSER. Presently, this VOLSER is entered manually when the user edits the JCL for each job at the JCL SETUP WORKSTATION.

The user would like to schedule an application with ONE job which has a JCL SETUP predecessor. The operator would be prompted at the SETUP operation to enter the VOLSER, then the job would be submitted and update a special resource which is an ETT TRIGGER to add an application containing other jobs that use the same VOLSER. How can the VOLSER be passed to the jobs in the dynamically added occurrence?.

Resolution:

(A "txt" version of this technote is attached, Because .txt is an ascii format using a fixed-pitch font, the included TWSz ISPF dialog panels and JCL display more clearly in that format.)

.


This solution uses the EQQPIFJV program to manipulate a TWSz JCL VARIABLE TABLE which is then accessed by multiple jobs.
.
First, take the EQQPIFJV sample from SEQQSAMP (it's release dependent), remove the last jobstep, leaving just the compile and link steps, and edit the JCL so it will run on your system. Then submit the job to create the EQQPIFT lmod, placing it into a loadlib available to TWSz scheduled jobs, and do an LLA refresh if required..
.
Then create the CARDIN data (SYSIN) for the EQQOIFT lmod to update the selected TWSz JCL TABLE and VARIABLE.
.
Next integrate an EQQPIFT jobstep into the job that updates the triggering SPECIAL RESOURCE. The following is the JCL from the test implementation from which this item was created:

TWSZ.V8R2M0.JOBLIB(PMR36842) - 01.10 Line 00000000 Col 001 080
********************************* Top of Data **********************************
//PMR36842 JOB (),'OPCTEST',CLASS=A,MSGCLASS=X,
// MSGLEVEL=(1,1),NOTIFY=ATKNSN
//*%OPC SCAN
//* PROMPTABLE VARIABLE VOLSERIN IS SET TO &VOLSERIN
//*
//* THE PIFJV STEP WILL SET THE VARIABLE VOLSEROU IN
//* TABLE JOBCARD TO THE VALUE SPECIFIED AT SETUP
//* TIME FOR PROMPTABLE VARIABLE VOLSERIN
//*
//PIFJV EXEC PGM=EQQPIFT,PARM='NOSTAE,NOSPIE',
// REGION=4096K
//STEPLIB DD DISP=SHR,DSN=USER.LINKLIB
//*EQQYPARM DD DISP=SHR,DSN=OPCA.INST.CNTL(YPARM)
//EQQMLIB DD DISP=SHR,DSN=TWSZ.V8R2M0.SEQQMSG0
//EQQMLOG DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//EQQDUMP DD SYSOUT=*
//EQQDMSG DD SYSOUT=*
//*
//CARDIN DD *
*
* THE RESOURCE JV IS USED FOR JCL VARIABLE TABLES
*
RESOURCE=JV SUBSYS=O82C
*
* UPDATE VARIABLE VOLSER IN TABLE JOBNAME
*
MODTABLE=JOBCARD
MODVAR=VOLSEROU
JCLVVDFL=&VOLSERIN
//*
//* THE FOLLOWING STEP USES THE PASSED VOLSER AND ALSO
//* ISSUES THE ETT TRIGGER
//*
//MCB49650 EXEC PROCA,VOLSER=&VOLSERIN
******************************** Bottom of Data ********************************

Next, create the JCL VARIABLE TABLE "JOBCARD" with the following two variables. (It would work just as well to add them to an existing table, so long at that table is associated with the application as described later).

EQQJVBSL ---------------- JCL VARIABLE SELECTION LIST -------- Row 1 to 2 of 2
Command ===> Scroll ===> CSR

Enter the row command S to display characteristics of selected variable

Variable table : JOBCARD
Description : Jobcard variables
Owner id : XSTEVEN
Last updated by : O82C on 06/25/07 at 17:55

Row Variable Subst. Setup Val Default
cmd Name Exit req Value

' VOLSERIN Promp Yes 000000
' VOLSEROU No No
******************************* Bottom of data ********************************

Note the VOLSEROU variable has NO default value (initially), and that the VOLSERIN variable has a default value of 000000. This variable is PROMPTABLE and also has the following settings:

EQQJVVMP ----------------- MODIFYING A JCL VARIABLE ---------------------------
Command ===>

Enter/Change data below, or DEP command to create/modify dependency,
enter VER command to define verification rules.

Variable table : JOBCARD Jobcard variables
Variable name : VOLSERIN

DESCRIPTION ===> VOLSER for next job_
Descriptive text
DEFAULT VALUE ===> 000000______________________________________
UPPER CASE ===> Y Y - Yes, N - No
SETUP ===> P Y - Yes, N - No, P - Prompt
SUBSTITUTION EXIT ===> ________ A load module name
VALUE REQUIRED ===> Y Y - Yes, N - No
DEFAULT POSITION ===> __ 01 - 80 A position in a JCL
instream data line
DIALOG TEXT ===> Enter Volume SERIAL NUMBER for PROCA_______________
===> ___________________________________________________
===> ___________________________________________________
===> ___________________________________________________

EQQJVVEP ------------- SPECIFYING VERIFICATION CRITERIA -----------------------
Command ===>

Enter data below, or enter the DEL command to delete the verification.

Variable name : VOLSERIN VOLSER for next job
Variable table : JOBCARD Jobcard variables

VERIFICATION TYPE ===> NUM____ ALPHA/NUM/ENUM/HEX/BIT/PICT/NAME/
DSNAME/RANGE/LIST

LENGTH COMPARISON ===> EQ EQ/LT/GT/LE/GE/NE/NL/NG
LENGTH VALUE ===> 06 1 to 44

For type PICT only - use characters C A N 9 X
PICT VALIDATION ===> ____________________________________________

LIST/RANGE NUMERIC ===> _ Y or N (if Y, specify the values below)
Separate each value (or pair of ranges) in the list with commas
LIST/RANGE VALUES ===> ___________________________________________________
___________________________________________________

Lastly, create application to schedule the setup job (In this example, job PMR36842 whose JCL is shown above):

EQQAMOSL ------------------------ OPERATIONS ----------------- Row 1 to 2 of 2
Command ===> Scroll ===> CSR

Enter/Change data in the rows, and/or enter any of the following
row commands:
I(nn) - Insert, R(nn),RR(nn) - Repeat, D(nn),DD - Delete
S - Select operation details, J - Edit JCL
Enter the TEXT command above to include operation text in this list, or,
enter the GRAPH command to view the list graphically.

Application : PMR36842VARSTEST

Row Oper Duration Job name Internal predecessors Morepreds
cmd ws no. HH:MM:SS -IntExt-
'''' SETP 010 00:00:01 PMR36842 ___ ___ ___ ___ ___ ___ ___ ___ 0 0
'''' CPU1 020 00:00:01 PMR36842 010 ___ ___ ___ ___ ___ ___ ___ 0 0
******************************* Bottom of data ********************************

When this application is added to the CP, the SETP operation appears on the SETP READY LIST, and when the user selects it with the ROWCOMMAND "N", instead of seeing the JCL, he sees the following:

EQQRLVAL -------- LIST OF JCL PREPARATION VARIABLES TO BE SET Row 1 to 1 of 1
Command ===> Scroll ===> CSR

Enter/change data in the rows, and/or enter the row command S to display
the Ready List Variable Response Panel.

Application id : PMR36842VARSTEST
Operation : CPU1 020
Jobname : PMR36842
EDIT JCL ===> N Edit the tailored JCL: Y ,or N

Row Variable Variable Variable
cmd name description value
' VOLSERIN VOLSER for next job 000000______________________________________
******************************* Bottom of data ********************************

He enters the value he wants for the VOLSER overtyping the 000000 and presses enter (or simply presses F3 to exit) and the SETP operation is set to COMPLETE. The value entered is set into the VOLSERIN JCL variable **FOR THIS SCHEDULED OCCURRENCE ONLY** and the CPU1 operation is submitted with the following JCL (In this example, the value entered was 987654):

//PMR36842 JOB (),'OPCTEST',CLASS=A,MSGCLASS=X,
// MSGLEVEL=(1,1),NOTIFY=ATKNSN
//*>OPC SCAN
//* PROMPTABLE VARIABLE VOLSERIN IS SET TO 987654
//*
//* THE PIFJV STEP WILL SET THE VARIABLE VOLSEROU IN TABLE
//* JOBCARD TO THE VALUE SPECIFIED AT SETUP TIME FOR
//* PROMPTABLE VARIABLE VOLSERIN
//PIFJV EXEC PGM=EQQPIFT,PARM='NOSTAE,NOSPIE',
// REGION=4096K
//STEPLIB DD DISP=SHR,DSN=USER.LINKLIB
//*EQQYPARM DD DISP=SHR,DSN=OPCA.INST.CNTL(YPARM)
//EQQMLIB DD DISP=SHR,DSN=TWSZ.V8R2M0.SEQQMSG0
//EQQMLOG DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//EQQDUMP DD SYSOUT=*
//EQQDMSG DD SYSOUT=*
//*
//CARDIN DD *
*
* THE RESOURCE JV IS USED FOR JCL VARIABLE TABLES
*
RESOURCE=JV SUBSYS=O82C
*
* UPDATE VARIABLE VOLSER IN TABLE JOBNAME
*
MODTABLE=JOBCARD
MODVAR=VOLSEROU
JCLVVDFL=987654
//*
//* THIS IS THE STEP THAT CREATES THE ETT TRIGGER
//*
//MCB49650 EXEC PROCA,VOLSER=987654

The first PIFJV jobstep executes and sets the variable VOLSEROU to whatever was entered for VOLSERIN:

EQQJVBSL ---------------- JCL VARIABLE SELECTION LIST -------- Row 1 to 2 of 2
Command ===> Scroll ===> CSR

Enter the row command S to display characteristics of selected variable

Variable table : JOBCARD
Description : Jobcard variables
Owner id : XSTEVEN
Last updated by : O82C on 06/26/07 at 18:32

Row Variable Subst. Setup Val Default
cmd Name Exit req Value

' VOLSERIN Promp Yes 000000
' VOLSEROU No No 987654
******************************* Bottom of data ********************************

This variable VOLSEROU is now available for any TWSz-scheduled jobs containing an &VOLSEROU variable, and the specified value will remain until changed. Note the DEFAULT value for VOLSERIN remains unchanged at 000000.

Also, note in the AS SUBMITTED JCL, above, that the proc that generates the ETT TRIGGER is called with the parm VOLSER= containing the specified VOLSERIN value. Thus we have now both passed the VOLSER value to the ETT TRIGGER job, and set it into a TWSz JCL VARIABLE TABLE so it is available to the ETT-added jobs.

PASSING.VRIABLES..txt

[{"Product":{"code":"SSRULV","label":"IBM Workload Scheduler for z\/OS"},"Business Unit":{"code":"BU011","label":"Systems - zSystems"},"Component":"--","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"All Versions;Version Independent","Edition":""}]

Document Information

Modified date:
13 September 2019

UID

swg21266387