EXEC Statement IQ for Experienced


Explain the JCL EXEC statement?

The main purpose of the EXEC statement is to provide the necessary information to the operating system to execute the job step, including the name of the program or utility to be run, any input or output datasets, and any other parameters or options required for the step.

What is the maximum number of steps in a job?

A JCL can have a maximum of 255 steps.

Describe the EXEC statement syntax and keywords?

//[stepname]  EXEC  parameters [comments]
  • Stepname - Step name is used to identify the step uniquely in the JCL. Step name is optional.
  • EXEC keyword - EXEC is the keyword used to code the EXEC step in JCL.
  • Parameters -
  • EXEC statement parameters are treated as local to the step and only apply to the specific step in the job.

Explain some of the commonly used parameters in the EXEC statement?

PGM, PROC, ACCT, ADDRSPC, COND, MEMLIMIT, RD, REGION, TIME, DYNAMNBR, and PARM.

What are three parameters you can specify on Job statement as well as on exec statement?

COND, REGION, TIME

What are rules for step name?

  • The stepname should start from the 3rd column.
  • Stepname can be 1-8 characters.
  • Stepname is a combination of alphanumeric and special characters (@,#, and $).
  • One blank/space should follow the stepname before EXEC.

PGM Parameter -

What is the significance of PGM parameter in EXEC statement?

PGM parameter is used to specify the program that needs to be run by the system.

Is the PGM parameter mandatory?

Yes. When used to provide the application program name.

PROC Parameter -

What is the significance of PROC parameter?

PROC parameter is used to specify the procedure that needs to be run by the system.

Is the PROC parameter is mandatory?

Optional. We can code proc name without PROC= keyword.

ACCT Parameter -

What is the significance of ACCT parameter in EXEC statement?

ACCT parameter is used to specify account information to which the CPU processing time of the specific step is billed.

Is ACCT parameter mandatory?

It is optional.

PARM Parameter -

What is the purpose of the PARM keyword in the EXEC statement?

PARM parameter is used to pass the input data from the JOB step to the program.

I have a COBOL program that accepts some input data. How do you code the JCL statement for this?

Using PARM keyword.

Frequently Asked Questions -

What is the purpose of the Exec statement in JCL?
Explain what EXEC statement is and what is the syntax of EXEC statement used in JCL?

Give details of some of the frequently used parameters in the EXEC statement?
What are the commonly used parameters on the EXEC statement and what do you they mean?

How to pass data to a program that is coded in an EXEC statement?

How can data be passed from one job step to the next in JCL?

How to pass the temp dataset form one JOB step to another?

Parameters COND, REGION, AND TIME can be coded on both the JOB and the EXEC statements?
What are the differences between using them on the JOB versus the EXEC statements, and in which statements are they commonly used?

How to pass parameters to the program as the job is being executed?