Reusable JCL collection
Previous topic | Next topic | Contents | Glossary | Contact z/OS | PDF


JCL statements: What does the EXEC statement do?

Reusable JCL collection

The EXEC statement marks the beginning of a step within a job, and specifies the name of a program or cataloged procedure to be run.

Procedures are named collections of partial JCL, usually one or more EXEC statements and data definition (DD) statements, that perform frequently used functions such as sorting data. Procedures are often called procs.

Programs and cataloged procedures are stored in specific data sets, which are called program or procedure libraries, respectively.

This JCL example contains only one EXEC statement (and therefore, only one job step).
//JOBNUM1 JOB  504,SMITH  PAYROLL
//STEP1   EXEC PGM=PROGRAM1
//DD1     DD   DSN=HLQ.INPUT
//
In this EXEC statement:
  • The name field contains the step name "STEP1". A step name is a one- through eight-character name that identifies the job step so that other JCL statements or the operating system can refer to it.
  • The parameter field contains the positional parameter PGM, which identifies the program to be run (PROGRAM1).

Also, the sample includes a DD statement that identifies the input data set, HLQ.INPUT, for the program. The JCL for a job step often contains several associated DD statements that define the program or procedure uses for input or output.

The end of a job step is indicated by a null statement, which consists of only two forward slashes (//); by another EXEC statement; or by another JOB statement. In this sample, STEP1 ends with a null statement that immediately follows the DD statement DD1.





Copyright IBM Corporation 1990, 2010