PEND Statement

Purpose

The PEND statement marks the end of an in-stream procedure. It must be used to terminate any procedure that begins with a PROC statement.

Syntax

jcl
1
//[name] PEND

Key Components

  • name - Optional 1-8 character name for the statement. Usually left blank as it has no functional purpose.

Example

jcl
1
2
3
4
//MYPROC PROC REGION=4M,CLASS=A //STEP1 EXEC PGM=IEFBR14,REGION=®ION //DD1 DD SYSOUT=&CLASS //PEND

Notes

  • Every in-stream procedure that begins with a PROC statement must end with a PEND statement
  • The PEND statement has no parameters
  • Only one PEND statement is allowed per procedure
  • If a PEND statement is missing, the system will treat the rest of the job stream as part of the procedure
  • PEND statements are not required for cataloged procedures (they are already contained within the procedure)

Related Concepts

Example with Procedure Invocation

jcl
1
2
3
4
5
6
//MYPROC PROC TYPE='REPORT',CLASS=A //STEP1 EXEC PGM=MYPGM,PARM='&TYPE' //PRINT DD SYSOUT=&CLASS //PEND //* Above is the procedure definition, below is its invocation //STEP01 EXEC MYPROC,TYPE='MONTHLY',CLASS=B