PROC
A piece of JCL kept under a name, so many jobs can use it.
Also written procedure, catalogued procedure, PROCLIB
Why it matters. Compiling a program takes the same steps every time. A procedure holds them once. A job calls it in one line.
See it
PROC starts a procedure. SRC and OUT are symbols with default values.
Syntax
//name PROC symbol=value //stepname EXEC PGM=... // PEND //stepname EXEC procname,symbol=value //procstep.ddname DD ... (override)
- PROC / PEND
- Start and end an in-stream procedure.
- symbol=value
- A value you pass in. Written &SYMBOL inside.
- procstep.ddname
- Override or add a DD for one procedure step.
- JCLLIB
- Says which libraries hold your procedures.
- PROCLIB
- The system's library of procedures.
Try it PROC
- 1
You're editing job PROCRUN. At the top it holds a procedure called CHKPROC, with one step, P1. Write the step that calls it. Call your step STEP1.
JCL //STEP1 EXEC CHKPROC - 2
Submit the job PROCRUN from your DEV JCL library.
SUBMIT 'ZB0001.DEV.JCL(PROCRUN)' - 3
Read the step messages, JESYSMSG. Find the step from the procedure.
OUTPUT PROCRUN JESYSMSG
Remember
- A PROC is JCL kept under a name.
- EXEC with a name and no PGM= calls it.
- A PROC can take values, so one procedure serves many jobs.
The usual mistake
//STEP1 EXEC PGM=CHKPROC
PGM= looks for a program called CHKPROC, not a procedure. It is not found, and the step ends with S806.
//STEP1 EXEC CHKPROC
On real z/OS
MF/OS joins the step name and the procedure step name with a full stop (STEP1.P1). Real messages show the two names side by side, step first. MF/OS allows only one level of procedure calls; real JCL allows 15.
Where can I practise PROC?
Right here, at ZedBank. You take a junior job at a simulated bank and use PROC in real work, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- JCLJob Control Language: the language used to tell the mainframe what programs to run, in what order, and with what files.
- EXEC statementThe JCL statement that starts a step by naming the program or procedure to run.
- Job stepOne program execution within a job. A job is simply a sequence of steps that run in order.
- MemberOne named item inside a partitioned dataset, such as a single program, job or copybook within a library.
- CompileTurning COBOL source code into machine instructions, checking the syntax and producing a listing of any errors.