Mainframe Path Start learning free
Core8 min readLesson 5 of 5

Procedures, symbols and overrides

A procedure is reusable JCL kept in a library. You call it, and optionally change parts of it from outside. Almost all production JCL is a short job calling a long procedure, so reading overrides is a core skill.

Two kinds of procedure

A catalogued procedure with symbols
* member PAYPROC in PROD.PAY.PROCLIB
//PAYPROC  PROC ENV=PROD,RUNDT=00000000
//CALC     EXEC PGM=PAYCALC,PARM='RUNDATE=&RUNDT'
//STEPLIB  DD DSN=&ENV..PAY.LOADLIB,DISP=SHR
//INFILE   DD DSN=&ENV..PAY.MASTER,DISP=SHR
//OUTFILE  DD DSN=&ENV..PAY.CALC,DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(50,10),RLSE)
//SYSOUT   DD SYSOUT=*

Calling it, and changing it

The job that uses it
//PAYRUN01 JOB (ACCT01),'MONTHLY PAY',CLASS=A,MSGCLASS=X
//RUN      EXEC PAYPROC,ENV=TEST,RUNDT=20260930
//* override just the input file inside the CALC step
//RUN.CALC.INFILE DD DSN=TEST.PAY.SMALLSET,DISP=SHR
//* add a DD that the procedure does not have
//RUN.CALC.DEBUG  DD SYSOUT=*

The override rules

  1. Overrides are written as stepname.ddname DD … where stepname is the step *inside* the procedure.
  2. An override replaces the whole DD statement, not just the parameter you mention. Anything you omit is lost.
  3. Overrides must appear in the same order as the steps in the procedure.
  4. A DD name that does not exist in the procedure is added to that step.
  5. Symbols supplied on the EXEC replace the defaults on the PROC statement.

Seeing what actually ran

Because a procedure hides most of the JCL, the expanded version in JESJCL is the only reliable record of what the system did. Expanded lines are marked so you can tell procedure text from your own. When a job behaves unexpectedly, reading JESJCL is usually faster than reasoning about the override rules.

Symbols the system supplies

SymbolValue
&SYSUIDThe userid that submitted the job
&SYSDATE / &SYSTIMEDate and time the job started
&SYSJOBNAMEThe job name
&SYSPLEXThe sysplex name

Common mistakes

Partial overrides

Copy the whole DD from the procedure, then change what you need. Never write a short override and hope the rest is inherited.

Overrides out of order

They must follow the procedure's step order or the job fails with a JCL error that names the wrong statement.

Single dot after a symbol

&ENV.PAY.MASTER looks for a symbol named ENV.PAY. You need &ENV..PAY.MASTER.

Editing the procedure to fix one job

Procedures are shared. Change the job, not the procedure, unless every caller should change.

What you will see at work

Key terms

Check your understanding.
Take this lesson's quiz and save your progress. Free.

Take the lesson quiz
← DISP, the parameter that causes the most troubleBack to JCL