|
Back Issue
|
User-specific Variable in JCL
MVS Version 4.2 introduced the &SYSUID variable which should contain the
userid associated with the batch job. This allows you, for instance, to
allocate user-specific datasets:
//REPORT JOB .... ,NOTIFY=&SYSUID
//STEP1 EXEC PGM=USERINFO
//SYSPRINT DD DISP=(,CATLG,DELETE),DSN=&SYSUID..USERINFO.LIST,
// SPACE=(TRK,1),UNIT=SYSDA
This program will allocate an output dataset userid.USERINFO.LIST. Note the
use of &SYSUID in the NOTIFY parameter to notify the userid associated with
the job.
The &SYSUID variable can also be used to allow user-specific values to
be assigned to symbolic variables for a job:
//REPORT JOB .... ,NOTIFY=&SYSUID
//RJCL JCLLIB ORDER=(&SYSUID..BATCH.PROFILE,APPL.JCL)
//STEP1 EXEC REPORT
The procedure REPORT could include the following JCL statement:
// INCLUDE MEMBER=SETVAR
which would include member SETVAR from either userid.BATCH.PROFILE or
APPL.JCL, if the member didn't exist in the user's BATCH.PROFILE dataset.
Member SETVAR could make use of JCL SET statements such as
// SET REGION='ONTARIO',PRTDEST='CENTRAL',SORT='COUNTY'
to assign values to symbolic variables that customize the procedure to
a specific user's needs without giving each person their own version of
the JCL procedures. Kind of an ISPF profile dataset for batch! A default
SETVAR member in APPL.JCL could be used if there was no user-specific
member.
Feedback
Comments or suggestions can be
sent to the author.
Last Month's Topic