EXEC statement parameters - IBM Mainframe

A job may consist of one or more steps. A step is a unit of work that is submitted to the operating system in the form of a collection of JCL statements. The EXEC statement is the first statement for each job step. The resources required for the execution of the job or program must be specified to the operating system. The system must be told the location of the program that is to be executed. The location specified must be universal for all job steps within the job or specific to a particular job step. The program to be executed must be identified and its name must be specified. Since the job consists of multiple job steps, each job step should have a unique jobname. If the different job steps are billed to different accounts, the different account numbers should be specified for each step. The program that is being executed may require values to be passed to it when it is run. The EXEC statement should have a provision to pass the values to the program. A job step may have specific storage requirements. Provision for specifying this should be provided. A job step may have higher priority than the other job steps in the job. A program may abend within a job. If a job has several steps, it may be necessary to terminate the entire job, just because a step has abended. So the job should have the capability to restart at any point. The following are the parameters of the EXEC statement:

  • Stepname - the job step's name
  • PCM - the name of the program to be executed
  • ACCT - account number for the job step
  • PARM - parameter for passing values to the program
  • JOBLIB - location of the program to be executed if the location is universal for all job steps within the job
  • STEPLIB - location of the program to be executed if the location is specific to a job step.
  • ADDRSPC - storage specification for a job step.
  • DPRTY- priority of the job step
  • PERFORM - access privileges to the system resources
  • RD - parameter to specify the restart at a job step in case of an abend.

The syntax of the EXEC statement is given below:

//stepname EXEC PCM = program-name, parameters

Where stepname is the name assigned to the job step, EXEC is the EXEC statement, program-name is the name of the program to be executed and this is followed by the keyword parameters like ACCT, PARAM, etc.

The EXEC statement must exist for each job step. The maximum number of EXEC statements that can be coded in a job is 255. Even though the stepname is optional, a valid and unique stepname should be coded to identify each job step. Positional parameters can be coded after the word EXEC and this can be followed by the keyword parameters.


The stepname is an optional field. But the system uses the stepname to refer to a job step in the system messages. So it is strongly recommended to give meaningful and unique stepname to all job steps in the job. There are no special syntax requirements for the stepname.

The stepname must consist of a maximum of 8 characters. The characters can be alphanumeric (A-Z or 0-9) or national (@, # and $) charactersxThe first character should be an alphabet or a national character. It must be code in column 3 immediately after the two slashes (//). It must be followed by at least one blank space. Some examples of stepnames are:

There are certain conditions under which stepnames are mandatory. This is when reference is made to a step that has been previously executed. For example, within the job you can reference a previously executed job step. Consider a situation where the execution of the second job step in a job is dependent on the success of the first job step. Here you need to reference the first job step and for that you need a name for the first job step. This is called the refer-back statement and a stepname is mandatory in this situation. Stepnames are mandatory when an overriding parameter (explained later) is used. You can restart a job from the job step that has failed using the RD parameter. The stepname is mandatory when the restart parameter is used.

The PGM Parameter

The PGM parameter identifies the name of the program that is to be executed. The syntax of the PGM parameter is PGM=program- name. The program-name that is specified in the PGM parameter should exist either in the system libraries, temporary libraries or private libraries. The system libraries contain all IBM supplied programs, whereas the temporary and private libraries are user-defined. The program must be a member of a PDS.

The ACCT Parameter

The ACCT parameter is used to specify the accounting information for the job step that it is used in. This parameter is very rarely used in the EXEC statement. The syntax of the ACCT parameter can be in any of the following format:

  • ACCT=(account-information, account-information)
  • ACCT=account-information

Where account-information consists of one or more sub-parameters defined by your installation. If the account information consists of more than one sub-parameter then each must be separated by a comma. If a sub-parameter consists of a special character then it should be enclosed in single quotes. The maximum number of characters that you can include in the accounting information including commas is 142.


The PARM Parameter

The PARM parameter is used to supply information to a program as it executes. The syntax of the parameter is PARM=value, where value is string with maximum length of 100 characters.

If the value string contains special characters, then it must be enclosed within single quotes. If the string is composed of several substrings, then each substring must be separated from the next by a comma, and the entire string must be enclosed within parentheses or single quotes.


The JOBLIB and STEPLIB Statements

It is not enough to know the name of the program to be executed (which you will specify in the PGM parameter), the system needs to know where the program resides..The EXEC statement identifies the member name only. Its location in the system has to be specified by the JOBLIB or STEPLIB statements.

The JOBLIB statement immediately follows the JOB statement. It is a DD (data definition) statement, and it specifies where the program that is given in the EXEC statement is located. The EXEC statements for one or more job steps that comprise that job follow the JOBLIB statement. The same JOBLIB apply to all subsequent EXEC statements, or in other words the programs for all the subsequent EXEC statements is present in the same location as the first one.

The JOBLIB statement must immediately follow the JOB statement and must precede the EXEC statements. It cannot be used in a cataloged procedure. If its location is uncataloged, that is, name and location are not recorded in the system, it must specify the unit and volume serial number of the device containing the program to be executed.

The function of the STEPLIB statement is the same as the JOBLIB statement. But, this statement is coded after the EXEC statement, instead of before it, and is effective only for the job step instead of the entire job.

The STEPLIB statement can be placed anywhere in the job step. It does not have to immediately follow the EXEC statement. STEPLIB statement can be coded in catalogued procedures. Unit and volume parameters must be specified for datasets that are uncataloged.

If both the JOBLIB and STEPLIB statements are coded, then the STEPLIB specification will override the JOBLIB specification for that job step. The specification of the JOBLIB will continue for any job steps that does not have a corresponding JOBLIB statement. If the same library is used for all the job steps, then it a good practice to code the JOBLIB statement.

The ADDRSPC Parameter

The purpose of this parameter is to indicate to the system that the job step is to use either virtual or real storage. Virtual storage results in program addresses being independent of the addresses that actually exist in the system. The technical term for this feature is 'paging'. Setting the ADDRSPC parameter to V1RT result in the job step being paged. If ADDRSPC is set to REAL, then job step is locked into real storage only. The syntax of ADDRSPCE is as follows:


Where VIRT indicates virtual storage and REAL indicates real storage. If ADDRSPC parameter is omitted VIRT is the default.

The DPRTY Parameter

This parameter is used to assign a dispatching priority to the job step. Dispatching priority is used by the system to determine the order in which tasks are to be executed. This is different from the CLASS priority in that CLASS assigns a priority to the job, and DPRTY assigns a priority to a job step.

The syntax of the parameter is DPRTY=(value1, value2), where valuel is a number from 0 to 15 and specifies the priority of the job step. The higher the number the higher the higher the priority. Value2 is also a number between 0 and 15. DPRTY is computed as follows:

DPRTY = (valuel * 16) + value2

The PERFORM Parameter

The PERFORM parameter is used to specify the performance group for the job step. A performance group determines, the rate at which the job steps in a program have access to system resources, and is helpful in optimizing system performance.

The syntax of this parameter is PERFORM=a, where n is a number from 1 to 999. This number must define a performance group that has been defined by your installation.

The RD Parameter

The RD (Restart Definition) parameter is used to specify automatic restart of a job if it abends. It also fully or partially suppresses the CHKPT (checkpoint) macro instruction, so that no checkpoints are taken as a program executes. A checkpoint is taken by the system to record the status of a program as it executes. The advantage of checkpoints is that, if a job abends, it can be restarted from the last successful checkpoint, rather that from the very beginning. The RD parameter can have any of the following formats:

  • RD=R
  • RD=RNC
  • RD=NR
  • RD=NC

Where R is for Restart, RNC is Restart with no checkpoint, RN is No automatic restart and NC is No checkpoint. When R is used automatic restart is indicated and the CHKPT macro is not suppressed. When RNC is in effect automatic restart is indicated but the CHKPT macro is suppressed. When NR is used automatic restart is suppressed and the CHKPT macro is not suppressed. When NC is used both automatic restart and the CHKPT macro are suppressed.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics