JCL EXEC Statement
EXEC statements have details of the program/procedure to be executed.
Maximum 255 steps can be coded in single JCL.
EXEC statement describes the beginning of the step.
Step name should be starts from 3rd column of length 8 characters.
Step can be ended with null statement (‘//’) or starting of another step.
EXEC statement identifies the step when the JOB submitted to system.
EXEC statement accepts all the JCL steps followed until the next EXEC found or the Null statement (‘//’) found
EXEC statement should start at 12th column and should end at 15th column.
123######101112##151617##################################################717273######80 | | | Name field Operation Operands
//stepname EXEC positional-parm[,keyword=parm] [,symbolic-parm=value] [comments]
EXEC statement can be divided into the below parts.
- Step name
- Positional parameter field
- Keyword parameters
Let’s discuss one by one in detail.
Stepname is of length 8 characters.
Allows the combination alphabets, numbers, @, # and $.
Name field is optional.
Stepname naming standards:
• The stepname must begin in column 3.
• The stepname of 8 characters length which allows alphabets (A-Z), numbers (0-9) and $, #, @ characters.
• The first character must be alphabet, $, # and @.
• The stepname must be followed by at least one blank.
Operation field describes about the type of operand.
Operation is nothing but EXEC.
Operation is of length 4 characters.
Starts from 12th character and continue up to 15th character.
Operation is mandatory with every step name.
Positional parameter field:
EXEC statement contains the positional parameters.
Positional parameters start at 17th column.
Positional parameters can end at any column between 17th to 72 columns.
Positional parameters are optional even though operation field is specified.
Positional parameters are 3 types.
1. PGM 2. PROC 3. No parameter
PGM parameter is used to execute the application program.
Main positional parameter of EXEC is PGM.
PGM parameter provides the name of the program to the operating system is to execute.
//Step-name EXEC PGM=program-name
The above syntax is used to execute the program-name and the keyword is PGM with EXEC.
PROC parameter is used to execute the in-stream or catalogue procedure.
PROC parameter first calls the in-stream or catalogue procedure and executes it.
//Step-name EXEC PROC=proc-name
The above syntax is used to execute a procedures and the keyword is PROC used with EXEC.
In this case, EXEC parameter coded with utility or catalogue procedure.
//Step-name EXEC utility/proc-name
The above syntax is used to execute the predefined utilities which are existed in the system.
EXEC statement used many parameters from JOB Card.
Keyword parameters used to override JOB level keyword parameters.
Keyword parameters are more at JOB level but the below parameters are mainly used with EXEC from JOB level.
1. TIME 2. REGION 3. COND
Let's discuss one by one here.
TIME specifies the maximum CPU usage time allowed for the EXEC to execute.
TIME parameter can be coded at the JOB level and step level too.
If TIME parameter coded at both JOB and Step level, it will take the minimum value from both to execute the particular step.
TIME parameter can be explained in detail here .
REGION parameter is used to specify the size of the virtual storage required to execute the step.
REGION parameter can be coded at JOB level and Step level.
If the REGION parameter coded at both JOB and Step level, Step level parameter overrides the JOB card parameter.
REGION parameter can be explained in detail here .
Condition parameter is used to decide execution of the particular step based on the previous step return code.
COND parameter can be coded at JOB level and Step level.
Maximum 8 conditions can be coded in single COND.
COND parameter can be explained in detail here .
A part from the above keyword parameters, there are some EXEC specific keyword parameters like below.
The PARM parameter is used to pass the data from JCL to program.
PARM always pass the data from JCL to current processing program by the step.
If JCL needs to pass more than one sub parameter, those should be separated by comma (,) which are enclosed in parentheses/quotes
PARM parameter can be explained in detail here .
Comment used to make a note of current statement.
Comment can be code in any column between 17th to 72 columns.
If any questions on the above, post your queries on Jcl Discussion forum
JCL PARM Parameter JCL EXEC TIME Parameter