PROC Statement

Purpose

The PROC statement marks the beginning of an in-stream procedure, or provides symbolic parameters for a cataloged procedure. It allows reusable JCL to be defined once and used multiple times.

Syntax

jcl
1
//procname PROC [parameter-1=value-1][,parameter-2=value-2]...

Key Components

  • procname - A 1-8 character name that identifies the procedure. Must begin with an alphabetic (A-Z) or national (@, #, $) character.
  • parameter=value - Optional symbolic parameters and their default values.

Example

jcl
1
2
3
4
5
6
7
8
//PAYPROC PROC INDS='PAYROLL.DATA', // REGION=4M, // SYSOUT='A' //STEP1 EXEC PGM=PAYROLL,REGION=®ION //SYSPRINT DD SYSOUT=&SYSOUT //INPUT DD DSN=&INDS,DISP=SHR //REPORT DD SYSOUT=&SYSOUT //PEND

Notes

  • A PROC statement must be the first statement in an in-stream procedure
  • A PROC statement must be paired with a PEND statement to define the procedure's scope
  • Symbolic parameters are referenced with an ampersand (&) prefix in the procedure body
  • Parameters defined on the PROC statement can be overridden when invoking the procedure
  • In-stream procedures must appear before they are referenced in the JCL stream

Related Concepts