PROC
A reusable piece of JCL stored as a member and invoked by name, so common steps are written once.
Also written procedure, catalogued procedure, PROCLIB
A procedure, universally called a PROC, is JCL kept in a library and called from a job by name. It saves repeating the same sequence of steps in every job that needs them.
Compiling a program is the standard example. The steps to compile, link and run are the same every time, so a site keeps them in a PROC and jobs invoke it in one line instead of restating twenty.
PROCs are parameterised. Symbolic variables inside them are given values when the PROC is called, so the same procedure serves many jobs with different dataset names, libraries and options. A calling job can also add or override individual DD statements within a step of the PROC, which is how one procedure covers cases its author never anticipated.
There are two kinds. A catalogued procedure lives in a procedure library available to everyone; an instream procedure is defined inside the job itself, which is handy while testing.
When a job runs, the output shows the PROC expanded into the steps it contributed, which is where you look when a call is not behaving as expected.
Related terms
- 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.