JCL Overriding Parameters Example


Replacing existing parameter -

PROC - Let us assume the PROC is calling in all steps.

//MTHPROC PROC
//STEP01  EXEC PGM=PROG1,COND=EVEN
//STEPLIB DD   DSN=MATEPK.COBOL.LOADLIB,DISP=SHR
//INPUT   DD   DSN=MATEPK.INPUT.OLDPS,DISP=SHR

PROG1 runs using MATEPK.INPUT.NEWPS as input.

Scenario1 - Changing the dataset name.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEPPR  EXEC MTHPROC
//STEP01.INPUT   DD   DSN=MATEPK.INPUT.NEWPS,DISP=SHR

Scenario2 - Changing the load library (STEPLIB).

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEPPR  EXEC MTHPROC
//STEP01.STEPLIB   DD   DSN=MATEPK.COBOL.LOADLIB1,DISP=SHR

Scenario3 - Overriding Program name.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEPPR  EXEC MTHPROC,PGM=PROG2

Scenario4 - Overriding COND.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEPPR  EXEC MTHPROC,COND=ONLY

Adding new parameter -

Scenario1 - Adding new DSNTYPE.

Code -

JCL -

//STEP01  EXEC PROC=MTHPROC
//STEP01.INPUT   DD   DSNTYPE=LARGE

PROC -

//MTHPROC PROC
//STEP01  EXEC PGM=PROG1
//INPUT   DD DSN=MATEPK.IEFBR14.PSFILE,
//           DISP=(NEW,CATLG,DELETE),
//           SPACE=(TRK,(3,2),RLSE),
//           UNIT=SYSDA,VOLUME=SER=DEVHD4,
//           DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)

MATEPK.IEFBR14.PSFILE creates with DSNTYPE parameter which is not coded in PROC.

Scenario2 - Adding COND parameter.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEPPR  EXEC MTHPROC,COND=ONLY

Nullify existing parameters -

Scenario - Nullify DSNTYPE.

JCL -

//STEP01  EXEC PROC=MTHPROC
//STEP01.INPUT   DD  DSNTYPE= 

PROC -

//MTHPROC PROC
//STEP01  EXEC PGM=PROG1
//INPUT   DD DSN=MATEPK.IEFBR14.PSFILE,
//           DISP=(NEW,CATLG,DELETE),
//           SPACE=(TRK,(3,2),RLSE),
//           UNIT=SYSDA,VOLUME=SER=DEVHD4,
//           DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800),
//           DSNTYPE=LARGE

MATEPK.IEFBR14.PSFILE creates with DSNTYPE parameter as empty.