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

JCL - Symbolic Parameters


Using Symbolic parameters in JCL/PROC is a good practice to modify any PROC parameters from the JOB.

This method gives the flexibility of using different parameters in Different jobs which are using a single PROC.

It is not only used to modify the proc parameters, it can also be used in the stand alone JOB.

While coding symbolic parameters, do not use KEYWORDS, PARAMETERS or SUB-PARAMETERS as symbolic names. Example: Do not use TIME=&TIME but yes you can use TIME=&TM and it is assumed as a right way of coding symbolics.

User-defined symbolic parameters are called JCL Symbols. There are certain symbols called system symbols, which are used for logon job executions. The only system symbol used in batch jobs by normal users is &SYSUID and this is used in the NOTIFY parameter in the JOB statement.
Let's see few examples below,

Example 1: Modifying the PROC parameters using Symbolic Parameters.

SYMB is the proc where its UNIT parameter is not given and instead used a Symbolic parameter.

PROC:

//SYMB PROC
//**************************************************************
//* Symbolic Parameters
//**************************************************************
//SYM001 EXEC PGM=PRG01
//SYMF01 DD DSN=SYM.TST.INF01,DISP=SHR
//SYMF02 DD DSN=SYM.TST.OUTF01,DISP=(NEW,CATLG,DELETE),
//    UNIT=&UNIT,SPACE=(CYL,(1,1),RLSE),
//    DCB=(RECFM=FB,LRECL=100,BLKSIZE=1000)
//*
// PEND

JOB to Override the UNIT value,

//PKMXTST1 JOB MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=USER1
// JCLLIB ORDER=(SYM.TR.SOURCE)
//*******************************************************
//* JOB REPLACE UNIT PARAMETER
//*******************************************************
//STEP1 EXEC PROC1,UNIT=SYSDA

Example 2: Modifying the file name HLQ using Symbolic parameters.

Below proc is written to execute a program TRCX99 where it has one input file and an output file. Input & Output files are not fixed here & it changes based on the Environment from where it triggered.

For example if it gets triggered from Credit card dept. then the File names should start with CR99 and if it is from the debit card dept. then the file names should start with DB99.

So in this case instead of writing two procs one for Credit & another ine for Debit, symbolic parameters can be used to give the file names dynamically.

PROC:

//SYMB02 PROC
//*****************************************************************
//* OVERRIDING THE DATASET SUB PARAMETERS
//***************************************************************
//*
//PRC001 EXEC PGM=TRCX99
//SYSPRINT DD SYSOUT=A
//TRCIN DD DSN=&HLQ..TR.X99.IN,DISP=SHR
//TRCOUT DD DSN=&HLQ..TR.X99.REP,DISP=(NEW,CATLG,DELETE),
// UNIT=&UNIT,SPACE=(CYL,(4,5),RLSE),
// DCB=(RECFM=FB,LRECL=210,BLKSIZE=2100)
//*
// PEND

JOB to pass the values:

//CRJOB JOB MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=CRUSER
//STEP1 EXEC SYMB02,UNIT=SYSDA,HLQ=CR99
//

Notes: In this way not only the HLQ (high Level Qualifier) but any other part of the file name can be modified.

Observe that Symbolic parameter in the file name should contain a (.) dot

Example 3: Modifying Program name using Symbolic Parameters.

PROC:

/SYMB03 PROC
//**************************************************************
//* Symbolic parameters
//**************************************************************
//SYM001 EXEC PGM=&PROG
// . . .
// PEND//

JOB to supply the value:

//CRJOB JOB MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=CRUSER
//STEP1 EXEC SYMB03,PROG=TRCX99
//

Example 4: Passing the PARM data using Symbolic Parameters.

PROC:

//PROC9 PROC
//****************************************
//* Supplying parm
//****************************************
//*
//PRC009 EXEC PGM=&PROG,PARM='&INPARM'

JOB to pass the parm data

//PRMTST1 JOB MSGLEVEL=(1,1),MSGCLASS=X
// JCLLIB ORDER=(PRTP.TR.SOURCE)
//****************************************************************
//* JOB REPLACE UNIT PARAMETER
//***************************************************************
//STEP1 EXEC PROC9,PROG=PRM700,INPARM=CR
//

In this case parm EXEC statement replaced as,

PGM=PRM700,PARM='CR'

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