INCLUDE Statement

Purpose

The INCLUDE statement incorporates JCL statements from a specified library member into the current job stream. This allows for modular JCL construction and code reuse.

Syntax

jcl
1
//[name] INCLUDE MEMBER=member-name

Key Parameters

  • name - An optional 1-8 character name that identifies the INCLUDE statement. Usually omitted.
  • MEMBER=member-name - Specifies the member name in a JCL library to be included.

Examples

Basic INCLUDE Statement

jcl
1
// INCLUDE MEMBER=STDPARM

INCLUDE with JCLLIB

jcl
1
2
3
4
5
6
//MYJOB JOB (ACCT123),'JOHN SMITH' // JCLLIB ORDER=(SYS1.PROCLIB,USER.JCLLIB) //* // INCLUDE MEMBER=STDPARM //* //STEP1 EXEC PGM=MYPROGRAM

Including DD Statements

jcl
1
2
3
4
//MYJOB JOB (ACCT123),'JOHN SMITH' //STEP1 EXEC PGM=PAYROLL // INCLUDE MEMBER=PAYDD /* This could contain standard DD statements for the PAYROLL program */ //REPORT DD SYSOUT=A

Notes

  • The INCLUDE statement can appear anywhere in a JCL job
  • A JCLLIB statement must precede the INCLUDE statement to identify the libraries to be searched
  • If no JCLLIB statement is present, the system searches the standard procedure libraries
  • The included statements replace the INCLUDE statement in the job stream
  • Included members can contain any JCL statements except JOB statements
  • Nested INCLUDE statements are allowed (an included member can contain another INCLUDE statement)
  • Up to 15 levels of nesting are supported
  • Symbolic substitution is performed on included statements

Related Concepts

Related Pages