You are on page 1of 14

Exec Statement - JCL

EXEC Statement
By: Rajani Konreddy & Vikalp Jain

Course Objectives
To understand
The EXEC Statement Overview Syntax of the EXEC statement Positional Parameters

Keyword Parameters
Error Codes on EXEC Statement

The EXEC Statement - Overview


The Exec Statement is the first statement of each job step. Used 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. For a proper execution of the job and program, the following issues become significant: Location and Identification of the program that is to be executed The program may require certain values to pass. Storage Requirements Priority of the program Required rate of access to system resources. Restart Specifications in case of Abnormal Termination.

The EXEC Statement - Syntax


//[stepname] [comments] EXEC <Parameters>

The EXEC statement consists of the characters // in columns 1 and 2 and four fields: name,operation (EXEC), parameter, and comments. An EXEC statement is required for each job step. A maximum

of 255 EXEC Statements can be specified within a single job.


Position and Keyword Parameters can be coded in the Operand Fields.

The EXEC Statement STEPNAME FIELD


A stepname is optional, but is needed for the following:
Referring to the step in later job control statements. When Overiding Parameters are Used. Performing a step or checkpoint restart at or in the step.

Code a step name as followed:


The stepname must begin in column 3. The stepname is 1 through 8 alphanumeric or national ($, #, @) characters. The first character must be alphabetic or national ($, #, @). The stepname must be followed by at least one blank.

The EXEC Statement Positional Parameters


An EXEC statement must contain one of the positional parameters: PGM or PROC. This positional parameter must precede all keyword parameters. Identifies the name of the program or procedure that is to be executed. Syntax:
//stepname EXEC PGM=program-name

Rules for Coding


The Program name specified in the PGM Parameter must exist in the system libraries, in temporary libraries or in private libraries. The program must be a member of a partitioned dataset.

The EXEC Statement Keyword Parameters


Keyword Parameters must follow the Positional Parameters. Unlike Positional Parameters, they can be coded COND in any sequence. REGION The following Keyword Parameters can be in EXEC TIME Statement:
ACCT PARM ADDRSPC DPRTY PERFORM RD

Keyword Parameters The ACCT Parameter


Is used to supply accounting information for the job step that is used in. It is rarely used in the EXEC Statement Syntax: ACCT=(account-information,accountinformation) Rules for Coding
In case of more than one sub-parameters, comma to be used. Special Characters must be enclosed in apostrophes. Maximum Characters including comma allowed are 142.

Example
//STEP1 EXEC PGM=PROGRAM,ACCT=(A123,RR)

Keyword Parameters The PARM Parameter


Is used to supply the information to a program as it executes. Syntax: PARM=value Rules for Coding
In case of more than one sub-parameters, comma to be used. Special Characters must be enclosed in apostrophes. length of the subparameters must not exceed 100 characters

Example
//RUN3 EXEC PGM=APG22,PARM=P1,123,P2=5

Keyword Parameters ADDRSPC Parameter


Is used to indicate to the system that the job step is to use either virtual or real storage. By default, Virtual storage is used. Syntax: ADDRSPC=VIRT or ADDRSPC=REAL Virtual Storage corresponds to PAGING. Example
//RUN3 //RUN3 EXEC EXEC PGM=APG22,ADDRSPC=REAL PGM=APG22,ADDRSPC=VIRT

Keyword Parameters The DPRTY Parameter


Is used to assign a dispatching priority to the job step. Dispatching Priority is used by the system to determining the order in which the tasks to be executed. Syntax: DPRTY=(value1,value2) where value1 is a number between 0 to 15. DPRTY=(value1)*16 + value2 Example
//RUN3 EXEC PGM=APG22,DPRTY=(12,9) The priority can be determined as 12*16+9 = 201

Keyword Parameters 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. Optimizes the performance. Syntax: PERFORM=n where n is a performance group. Example
//RUN3 EXEC PGM=APG22,PERFORM=10

Keyword Parameters The RD Parameter


Restart Definition Parameter. Is used to specify the automatic restart of a job if it abends. A Performance group determines the rate at which the Job Steps in a program have access to system resources. Suppresses the CHKPT macro instruction partially or fully Syntax: RD=R or RD=RNC or RD=NR or RD=NC R Restart, RNC Restart with no checkpoint, NR No Automatic Restart, NC No Checkpoint. Example
//RUN3 EXEC PGM=APG22,RD=RNC

THINGS THAT CAN GO WRONG


ERROR CODE IEF605I IEF607I IEF647I DESCRIPTION Unidentified Operation field Job has no steps. First Character of the name is not alphabetic or not national on the EXEC Statement Requested module xxxxx not found Misplaced JOBLIB Statement Misplaced DD Statement CAUSE Forgetting to code the EXEC Statement Coding an invalid Stepname Executing a non existing pgm Coding JOBLIB after STEPNAME Coding STEPLIB Before EXEC

CSV003I IEF636I IEF606I

You might also like