M Lee Klein
New User
Joined: 08 Feb 2022 Posts: 39 Location: USA
|
|
|
|
I have this jcl that I run to extract from an archive.
I'd like to be able to use variables for items in bold so that I can use an input file and run this job multiple times for each member in the input file.
Suggestions on where to start?
//STEP1 EXEC PGM=SARBCH,PARM='MK.SAR.PROD'
//SYSPRINT DD SYSOUT=*
//DISKOUT DD DSN=MK.TEST.SAR.JB4179,MGMTCLAS=MCNOBD,
// DISP=(NEW,CATLG,CATLG),UNIT=SYSDA,
// DCB=(RECFM=FBA,LRECL=121,BLKSIZE=0),
// SPACE=(CYL,(20,10),RLSE)
//SYSIN DD *
/PRINT ID=ABCDEFG DDNAME=DISKOUT GEN=11578 SEQ=0002
//
INPUT file
JB1234,ABCDEFG,11578,1
JB2345,HIGKLMN,11579,2
JB3456,OPQRSTU,11580,1
etc... |
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2140 Location: USA
|
|
|
|
The SET-variables in JCL are resolved before the job is submitted (similar to macro expansion). You cannot do it taking values from the file, when the job is running.
If you do not change your general (wrong) approach, you must do it in two separate stages = two separate jobs.
Stage 1. The preparation job. It takes your “parameters” a.k.a. values from your file, and creates (as regular text) the JCL itself, to be used at stage 2.
Stage 2. You can submit the dynamically generated JCL text from stage 1, to be executed as normal job (with no “variables” used at this time. |
|