TSO-ISPF JCL COBOL VSAM DB2 CICS IMS-DB Tools Articles Forum Quiz Interview Q&A

JCL - EXEC Statement

The EXEC statement marks the beginning of each step in a job or a procedure.

EXEC (execute) statement to identify the program or cataloged or in-stream procedure that this job step is to execute and to tell the system how to process the job step.

A job can have a maximum of 255 job steps. This maximum includes all steps in any procedures the EXEC statements call.

The parameters you can specify for exec processing are listed below. Also we provided explanation below for only which you'll most often use.
  • ACCT
  • COND
  • PARM
  • PGM
  • PROC and procedure name
  • RD
  • TIME

COND Parameter:

In a multi-step job, use the COND parameter to specify the conditions that allow the system to bypass a step by testing return codes from any or all previous steps. You can code up to eight comparisons. If any comparison is true, the system bypasses the step.

As an alternative, you may use the IF/THEN/ELSE statement, which you might find easier to code than COND parameter conditions.

PARM Parameter:

Use the PARM parameter to pass variable information to the processing program executed by this job step. To use the information, the processing program must contain instructions to retrieve the information.

PGM Parameter:

The PGM parameter identifies the program the system is to run.

z/OS includes a number of programs, called utilities, which are useful in batch processing. These programs provide many small, obvious, and useful functions. For example, z/OS has a utility program named IEBGENER to copy data.

Customer sites often add their own customer-written utility programs (although most users refrain from naming them utilities) and many of these are widely shared by the user community. Independent software vendors also provide many similar products (for a fee).

PROC and procedure name Parameters:

The PROC parameter or procedure name identifies the cataloged or in-stream procedure the system is to run.

If you omit the PGM or PROC parameter, z/OS automatically assumes that you are specifying a procedure that you want to run.

The following code illustrates the three ways to correctly code this positional parameter.

//STEP1 EXEC PGM=program-name
//STEP1 EXEC PROC=procedure-name
//STEP1 EXEC procedure-name

Lowercase text is variable text that you provide. You may code only one of these formats on a single EXEC statement.

REGION Parameter:

Use the REGION parameter to override the default amount of storage space (in kilobytes or megabytes) that the system allocates to a particular job or job step.

You may code the REGION parameter on the JOB statement and the EXEC statement. If REGION appears on both statements, the value on the JOB statement overrides that on the EXEC statement.

If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!

Are you looking for Job Change? Job Portal