PGM Parameter

Purpose

The PGM parameter in JCL is used on the EXEC statement to specify the name of the program to be executed in a job step. It identifies the specific program module from a program library that the system should load and run.

Syntax

jcl
1
//stepname EXEC PGM=program-name

Format

  • program-name: 1-8 character name of a program module
  • Must be a member of a partitioned data set in the job step library search order
  • The program must be in load module format or program object format
  • Cannot be specified with PROC parameter on the same EXEC statement

Examples

Basic Usage

jcl
1
//STEP1 EXEC PGM=IEFBR14

Executes the system utility program IEFBR14

With Parameters

jcl
1
//STEP2 EXEC PGM=SORT,PARM='EQUALS,FILSZ=E4000'

Executes the SORT program with parameters

With Region Size

jcl
1
//COMPSTEP EXEC PGM=IKFCBL00,REGION=4M

Executes the COBOL compiler with a 4MB region size

With Condition Code

jcl
1
//STEP3 EXEC PGM=IDCAMS,COND=(4,LE)

Executes IDCAMS program only if all previous steps completed with a condition code less than or equal to 4

Common Programs

  • IEFBR14 - System null program (does nothing successfully)
  • IDCAMS - Access Method Services utility for VSAM datasets
  • IEBGENER - Data set copy utility
  • IEBCOPY - Partitioned data set copy utility
  • SORT/DFSORT - Sorting and merging utility
  • IKFCBL00 - COBOL compiler
  • IEV90 - Assembler
  • IEWL - Linkage editor
  • IKJEFT01 - TSO terminal monitor program (for executing TSO commands in batch)

Search Order

The system searches for the program in the following order:

  1. STEPLIB DD (if present)
  2. JOBLIB DD (if present and no STEPLIB)
  3. Link list (system libraries specified in LNKLSTxx)
  4. Link pack area (LPA)

Notes

  • You must specify either PGM or PROC on each EXEC statement (but not both)
  • The program name is case-sensitive and must match the name in the program library
  • Special characters and spaces are not allowed in program names
  • Programs must be in load module format (prepared by the linkage editor)
  • System messages typically include the program name for diagnostic purposes
  • Some programs require specific DD statements to function properly
  • If a program cannot be found, the job step will fail with a JCL error

Common Mistakes

  • Misspelling program names
  • Failing to include necessary STEPLIB or JOBLIB statements for custom programs
  • Using both PGM and PROC parameters in the same EXEC statement
  • Forgetting required DD statements for the specified program
  • Executing a program with insufficient region size

Related Concepts

Related Pages