Overriding Datasets & Parameters
Overriding parameters is a technique that allows us to replace the coded parameter values temporarily. This technique is mainly used to replace the parameter values coded in the PROC from the calling JCL. This way, we can modify all parameter values without changing the actual PROC.
The overriding parameters can be coded with the EXEC statement at the step level. This is useful when running the same job with different input or output datasets without changing the PROC.
Overriding parameter can be done in 3 ways -
- Replacing existing parameter.
- Adding new parameter.
- Nullify existing parameters.
Replacing existing parameter -
This overriding type replaces the existing parameter, which is already coded in PROC.
Syntax -
//STEPname EXEC proc-name,modifying-parameter1,
// modifying-parameter2,..
//PROC proc-name
Examples -
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.
JCL -
//STEPPR EXEC MTHPROC
//STEP01.INPUT DD DSN=MATEPK.INPUT.NEWPS,DISP=SHR
Adding new parameter -
This type of overriding adds the parameter to the statement that is not already coded in PROC.
Syntax -
//STEPname EXEC proc-name,new-parameter1,
// new-parameter2,..
//PROC proc-name
Examples -
Scenario1 - Adding new DSNTYPE.
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.
Nullify existing parameters -
This type of overriding deletes the existing parameter that is already coded in PROC.
Syntax -
//STEPname EXEC proc-name
//STEPname.DDname DD parameter1,parameter2,..
//PROC proc-name
Examples -
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.