TSO-ISPF JCL COBOL VSAM DB2 CICS IMS-DB Tools Articles Forum Quiz Interview Q&A

JCL - Procedure Modification Examples


Example 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=PKMXG.TCPR.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. For example:

PROC: Proc name - PROC1

//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

Example 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

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)

If you need to override only one parameter in the DD statement, then you don't need to add all the parameters.


Example 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.PRC001=

Multiple parameters can be nullified.

//STP01 EXEC PROCT,UNIT=,ACCT=

Example 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=

Example 5: Supplying In-Stream data

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

Example 6: Overriding the Concatenated data sets:
  1. To override the first dsn in the concatenated list, then coding only the first one is enough.

  2. To override other than the first one, then all the DSN needs to be mentioned.

  3. 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 PROC2,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 PROC2,UNIT=SYSDA
//SYSUT1 DD
//       DD DSN=PRT.CRX.IEBGNR.IN4,DISP=SHR
//       DD
//       DD
//

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

In next chapter, we are going to see JCL Symbolic parameters. This allows us to modify JCL statements in a job easily.


If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!

Are you looking for Job Change? Job Portal