JCL override with examples

JCL override with examples

JCL/PROC override is useful when a proc parameters, data sets needs to be modified while executing it. Adding parameters, Nullifying the existing parameters or Overriding the parameters of a PROC are the common overrides that can be done via a JOB.

1. Overriding a DSN:

PROC has an input data set and this needs to be modified while running the job. So below override can be used.

//PROC1 PROC 
//**************************************************************
//* OVERRIDE EXAMPLES 
//**************************************************************
//PRC001 EXEC PGM=IEBGENER 
//SYSPRINT DD SYSOUT=A 
//SYSIN DD DUMMY 
//SYSUT1 DD DSN=PRDG.CST.IEBGNR.IN,DISP=SHR 
//SYSUT2 DD DSN=PRDG.CST.IEBGNR.O1T,DISP=(NEW,CATLG,DELETE),
// UNIT=&UNIT,SPACE=(CYL,(1,1),RLSE), 
// DCB=(RECFM=FB,LRECL=100,BLKSIZE=1000) 
//* 
// PEND

JOB with Override DSN

Here the JOB gets executed with the new data set given in the JOB instead of the dataset given in the PROC

//JOBTST1 JOB MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=JCLSCAN 
//*
//********************************************************
//* OVERRIDING DATASET 
//********************************************************
//STEP1 EXEC PROC1,UNIT=SYSDB 
//PRC001.SYSUT1 DD DSN=PRDG.CST.IEBGNR.IN1,DISP=SHR

If the PROC has only one step then Procstep name is not required. It can be coded as below

//STEP1 EXEC PROC1,UNIT=SYSDB 
//SYSUT1 DD DSN=PRDG.TCP.IEBGNR.IN1,DISP=SHR

If there are multiple steps and in each step the DD name is same then ignoring proc step name overrides only the first step values.

Example:

//PRC001 EXEC PGM=PGM1 
//INFIL DD DSN=TEST.IN.F001,DISP=SHR 
.
.
//PRC002 EXEC PGM=PGM2 
//INFIL DD DSN=TEST.IN.F002,DISP=SHR 
.
.

JOB:
In this case only the INFIL of PRC001 gets overridden.

.
.
//STEP1 EXEC PROC1,UNIT=SYSDB 
//INFIL DD DSN=TST.IN.DB.FILE,DISP=SHR

2. Overriding DSN SUb parameters.

UNIT, Volume, Space etc parameters specified against the DSN can also be modified from the job.

PROC:

//PROCT PROC 
//*********************************************************************
//* OVERRIDING THE DATASET SUB PARAMETERS 
//*************************************************************** 
//PRC001 EXEC PGM=TRKTST 
//SYSPRINT DD SYSOUT=A 
//SYSIN DD DUMMY 
//INFIL1 DD DSN=TTRKY.OVRD.IN.F01,DISP=SHR 
//OTFIL1 DD DSN=TTRKY.OVRD.OT.F01,DISP=(NEW,CATLG,DELETE), 
// UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE), 
// DCB=(RECFM=FB,LRECL=100,BLKSIZE=1000) 
//* 
// PEND

Wrong way of coding the job
We can not code only the required sub parameter. Here All the parameters whether they are required to be modified or not should be specified.

//**********************************************************
//* JOB REPLACE UNIT PARAMETER 
//**********************************************************
//STP01 EXEC PROCT,UNIT=SYSDB 
//PRC001.INFIL1 UNIT=SYSDB

Correct Way:
Sub parameters given in the override step would be effective. If you Omit the DSN sub parameters(DISP, UNIT, DCB etc), then these will not be nullified instead it takes this data from the PROC if they exist.

//STP01 EXEC PROCT 
//PRC001.OTFIL1 DD DSN=TTRKY.OVRD.OT.F01,DISP=(MOD,CATLG,DELETE),
// UNIT=SYSDB,SPACE=(CYL,(2,5),RLSE), 
// DCB=(RECFM=FB,LRECL=90,BLKSIZE=9000)

3. Nullifying the Parameters:

IN case the parameters specified in the PROC needs to be nullified then code it with out any value. It nullifies the specified sub parameters in all of the PROC steps.

//STP01 EXEC PROCT,UNIT=,

If the parameters should be nullified in any particular step then step name should be mentioned.

//STP01 EXEC PROCT,UNIT=,ACCT=

Multiple parameters can be nullified.

//STP01 EXEC PROCT,UNIT.PRC001=

4. Adding DSN SUb parameters.

//STP01 EXEC PROC1,ACCT.PRC001=2516

Adding and Nullifying parameters can be given together.

//STP01 EXEC PROC1,ACCT.PRC001=2516,UNIT=

5. Supplying IN stream Data:

//STP01 EXEC PROC1,UNIT=SYSDB 
//PRC001.SYSN DD *
.
.
/*

6. Overriding the Concatenated data sets:

  • To override the first dsn in the concatenated list, then coding only the first one is enough.
  • To override other than the first one, then all the DSN needs to be mentioned.
  • Order of the overriding DD statement must be same as the proc dd order.

Below PROC has 4 concatenated data sets as input.

//PRO11 PROC 
//********************************************************************
//* OVERRIDING THE CONCATENATED DATA SETS
//*************************************************************** 
//* 
//PRC002 EXEC PGM=IEBGENER 
//SYSPRINT DD SYSOUT=A 
//SYSIN DD DUMMY 
//SYSUT1 DD DSN=PRT.CRX.IEBGNR.IN,DISP=SHR 
//       DD DSN=PRT.CRX.IEBGNR.IN1,DISP=SHR 
//       DD DSN=PRT.CRX.IEBGNR.IN2,DISP=SHR 
//       DD DSN=PRT.CRX.IEBGNR.IN3,DISP=SHR 
//SYSUT2 DD DSN=PRT.CRX.IEBGNR.O2T,DISP=(NEW,CATLG,DELETE), 
// UNIT=&UNIT,SPACE=(CYL,(1,1),RLSE), 
// DCB=(RECFM=FB,LRECL=090,BLKSIZE=9000) 
//* 
// PEND

To override the First parameter –> Only first DSN is enough

//STEP1 EXEC PRO11,UNIT=SYSDA 
//SYSUT1 DD DSN=PRT.CRX.IEBGNR.IN4,DISP=SHR

To override the 2nd DSN –>¬†All other DD statements are must but the DSN can be left blank so that the Original DSN mentioned in the PROC would be taken.

//STEP1 EXEC PRO11,UNIT=SYSDA 
//SYSUT1 DD DSN= 
// DD DSN=PRT.CRX.IEBGNR.IN4,DISP=SHR 
// DD DSN= 
// DD DSN= 
//

NOTES:

PGM parameter can not be modified but this can be achieved by symbolic parameters.

Add a Comment

Your email address will not be published. Required fields are marked *