Вы находитесь на странице: 1из 181

JCL Introduction

JCL Tutorial Topics Index


JCL Coding Sheet

JCL is an acronym for Job Control language.


Job control language (JCL) is a set of statements.
A JCL statement coded tells the z/OS operating system about the work want
to perform.
JCL defining and controlling the program execution to get the desired output
based on the input.
JCL statements tell z/OS where to find the input, how to process that input
(what programs/utilities to run) and what to do with the resulting output.
JCL is set of steps where each step has a specific task to complete.
JCL executes the program by using input/output files in batch environment.
JCL acts as a bridge between the Operating System (z/OS) and program.
JCL may contain more than one step and up to 255 steps.
JCL at max contains 255 steps. If the steps to execute are more than 255,
then two JCLs required for completing the task.

All jobs use three JCL statements:

1. One JOB statement


2. One or more EXEC statements
3. One or more DD statements

We will discuss about these three in the further chapters.


JCL must begin with ‘//’ in the first two columns continued by JCL statements.
JCL must end with’//’.

Sample list of things that can do with JCL:

• Compile COBOL program.


• Compile COBOL + DB2 program
• Compile COBOL + DB2 +CICS program
• Run COBOL program
• Run COBOL+DB2 program
• Bind DB2 program
• Create datasets. i.e. PS and PDS.
• Create GDG’s and VSAM files.
• Concatenate data from multiple files.
• Merge data from multiple files.
• Execute the utilities like IEBCOPY, DFSORT, IEBGENER and IDCAMS.
• Copy data from one file to other.
• And so on..

Example:
Simple JCL to explain different JCL statements.

=COLS> ----+----1----+----2----+----3----+----4----+----5----
+----6----+----7--
****** ***************************** Top of Data
******************************
000001 //MTHUSERJ JOB (META007),'PAWAN
Y',CLASS=A,MSGCLASS=L,MSGLEVEL=(1,1),
000002 // TIME=1440,NOTIFY=&SYSUID
000003 //*
000004 //JOBLIB DD DSN=MTHUSER.MY.LOADLIB,DISP=SHR
000005 //*
000006 //STEP01 EXEC PGM=EXAMPROG
000007 //STEPLIB DD DSN=MTHUSER.TEST.LOADLIB,DISP=SHR
000008 //INPFILE DD DSN=MTHUSER.EXAMPROG.INPUT,DISP=SHR
000009 //OUTFILE DD DSN=MTHUSER.EXAMPROG.OUTPUT,
000010 // DISP=(NEW,CATLG,DELETE),
000011 // UNIT=(SYSDA,20),
000012 // SPACE=(CYL,(50,25)),
000013 // DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,BUFNO=2)
000014 //*
000015 //SYSPRINT DD SYSOUT=*
000016 //SYSUDUMP DD SYSOUT=*
000017 //SYSOUT DD SYSOUT=*
****** **************************** Bottom of Data
****************************
JCL Coding Sheet
JCL Introduction
JCL Structure

1& 2 Columns - Every line of coding in the JCL should


start with //.
// are mandatory for every line in the JCL
except input cards.
3 - * in third column will indicate that the line
is comment.

4-10 - Name field


11 - One space should be existed in between the
Name and Operation.

12-15 - Operation
16 - One space should be existed in between the
Operation and Operands.

17-71 - Operand
72 - Continuation column

Each line in JCL will be treated as two types.

1. JCL Statement
2. JCL comment

JCL Statement:
JCL statement is an active statement which specifies an action to complete.
JCL comment is inactive statement which provides information to understand
about the JCL statement.

Each JCL statement can be divided into three parts.


1. Name field
2. Operation
3. Operand

Name Field:

Name field is of length 8 characters.


Name field specifies the DD name in DD statement or step name in EXEC
statement or Job name in JOB Statement.
Allows the combination alphabets, numbers, @, # and $.
First letter should not be number.
Starts from 3rd character and continue up to 11 characters.
Name field is optional during the concatenation of DD statements. In
remaining all situations it is required but not mandatory.

Operation:

Operation field describes about the type of operand.


Operation field specifies the operation type like JOB for JOB statement,
EXEC for EXEC statement, DD for DD statement and PEND for PROC end.
Operation is of length 4 characters.
Starts from 12th character and continue up to 15th character.
Operation is mandatory with every name field.
Operation field should be any one of the JOB, EXEC, DD and PEND.
The operation field can also code in the operand coding positions if the name
field specified.

Operand:

Operand describes the parameters for the operation.


Operand starts at 17th column and continue up 72 columns.
Operand can end at any column between 17th to 72 columns.
Operand field is mandatory if operation field is specified.
If the operand is more than 55 characters, it can be continued in the next line.
But need to do two things.

1. Current statement should end with ‘,’ in 72 column.


2. 2. The remaining operand can start from or before 16th column in the
next line.

If the remaining operand not started from or before 16th column, then the
below error message will be displayed during JSCAN.
“E1 8 DSS10075E CONTINUATION LINE STARTS BEYOND COLUMN 16.”

Example:

Simple JCL to explain different JCL statements.

=COLS> ----+----1----+----2----+----3----+----4----+----5----
+----6----+----7--
****** ***************************** Top of Data
******************************
000001 //MTHUSERR JOB (META007),'PAWAN
Y',CLASS=A,MSGCLASS=L,MSGLEVEL=(1,1),
000002 // TIME=1440,NOTIFY=&SYSUID
000004 //JOBLIB DD DSN=MTHUSER.MY.LOADLIB,DISP=SHR
000008 //STEP01 EXEC PGM=EXAMPROG
000009 //STEPLIB DD DSN=MTHUSER.TEST.LOADLIB,DISP=SHR
000010 //INPFILE DD DSN=MTHUSER.EXAMPROG.INPUT,DISP=SHR
000011 //OUTFILE DD DSN=MTHUSER.EXAMPROG.OUTPUT,
000012 // DISP=(NEW,CATLG,DELETE),
000013 // UNIT=(SYSDA,20),
000014 // SPACE=(CYL,(50,25)),
000015 // DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,BUFNO=2)
000017 //SYSPRINT DD SYSOUT=*
000018 //SYSUDUMP DD SYSOUT=*
000019 //SYSOUT DD SYSOUT=*
****** **************************** Bottom of Data
****************************

JCL Comment:
JCL comment is inactive statement which provides information to understand
about the JCL statement.
Comment used to specify a note about the current or beside statement.
Comment should have a ‘*’ in the third column.
Comment text can start in any column of any row but the third column should
have ‘*’.
Otherwise, JCL tries to treat it as a normal JCL statement and thorow error
during the execution.

Note:
If the Null indicator (//) alone coded in the Job, then it will treat as End of the
JOB.

Example:

Simple JCL to explain different JCL statements.

=COLS> ----+----1----+----2----+----3----+----4----+----5----
+----6----+----7--
****** ***************************** Top of Data
******************************
000001 //MTHUSERR JOB (META007),'PAWAN
Y',CLASS=A,MSGCLASS=L,MSGLEVEL=(1,1),
000002 // TIME=1440,NOTIFY=&SYSUID
000003 //*
000004 //JOBLIB DD DSN=MTHUSER.MY.LOADLIB,DISP=SHR
000005 //*
000006 //* EXAMPORG RUNNING STEP
000007 //*
000008 //STEP01 EXEC PGM=EXAMPROG
000009 //STEPLIB DD DSN=MTHUSER.TEST.LOADLIB,DISP=SHR
000010 //INPFILE DD DSN=MTHUSER.EXAMPROG.INPUT,DISP=SHR
000011 //OUTFILE DD DSN=MTHUSER.EXAMPROG.OUTPUT,
000012 // DISP=(NEW,CATLG,DELETE),
000013 // UNIT=(SYSDA,20),
000014 // SPACE=(CYL,(50,25)),
000015 // DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,BUFNO=2)
000016 //*
000017 //SYSPRINT DD SYSOUT=*
000018 //SYSUDUMP DD SYSOUT=*
000019 //SYSOUT DD SYSOUT=*
****** **************************** Bottom of Data
****************************
JCL Structure
JCL Coding Sheet
JCL Job Card

JCL structure defines the predefined way of JCL creation.


This chapter we will discuss about JCL structure and the way of JCL creation.
Sample JCL structure shown in the below diagram.

JOB
|
|
EXEC
|
|
DD
Normally, JCL structure mainly contains two major parts.

1. JOB Card/JOB Statement


2. JOB Body/JOB Steps

JOB Card:
JOB card is used identify the job or the unit of work the operating system to
perform.
JOB card is the first statement to the JOB.
JOB card should always be coded as a first statement in the JOB.
JOB card should be coded only once in the specific JOB.
JOB card is the first control statement in the JOB.
JCL language requires JOB card to identify the particular JOB.
JOB card used to make the OS also aware of the specific JOB after
submission.
JOB card started with slashes (‘//’) in the first two positions.
JOB card can be coded in the multiple lines without having the continuation
character in the 72th column.
JOB card has the accounting information and job related information.
JOB card has multiple parameters which actually plays a key role in
identifying the account information, user information and also providing the
information about how to run the particular job.
JOB card parameters can be divided into two types based on their behavior.

1. Positional parameters.
2. Keyword parameters.
JOB Card can be explained can be explained detail in further chapters. Use
the left navigation for the further chapter details

JOB Body:
Except the JOB Card, remaining part of the JOB is JOB body.
JOB body contains set of steps.
Each step contains one EXEC statement and/or one or more DD statements.
EXEC statement is mandatory for the particular step of JOB Body.
DD statement is optional for the particular step of JOB body.
A step may not contain DD statement if executing a program which does not
have any file input or executing a utility.
Comment line also consider as part of JOB body.
A step can contain up to 255 DD statements.
EXEC statement can also contain keyword parameters which will override the
keyword parameter values in the JOB card for the specific step.
Every step in the JOB Body can be divided into two parts.

1. EXEC
2. DD

EXEC and DD statements can be explained detail in further chapters. Use the
left navigation for the further chapter details

Example:

Simple JCL to explain different JCL statements.

=COLS> ----+----1----+----2----+----3----+----4----+----5----
+----6----+----7--
****** ***************************** Top of Data
******************************
000001 //MTHUSERR JOB (META007),'PAWAN
Y',CLASS=A,MSGCLASS=L,MSGLEVEL=(1,1),
000002 // TIME=1440,NOTIFY=&SYSUID
000005 //*
000006 //* EXAMPORG RUNNING STEP
000007 //*
000008 //STEP01 EXEC PGM=EXAMPROG
000009 //STEPLIB DD DSN=MTHUSER.TEST.LOADLIB,DISP=SHR
000010 //INPFILE DD DSN=MTHUSER.EXAMPROG.INPUT,DISP=SHR
000011 //OUTFILE DD DSN=MTHUSER.EXAMPROG.OUTPUT,
000012 // DISP=(NEW,CATLG,DELETE),
000013 // UNIT=(SYSDA,20),
000014 // SPACE=(CYL,(50,25)),
000015 // DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,BUFNO=2)
000016 //*
000017 //SYSPRINT DD SYSOUT=*
000018 //SYSUDUMP DD SYSOUT=*
000019 //SYSOUT DD SYSOUT=*
****** **************************** Bottom of Data
****************************

JCL JOB Card


JCL Structure
Jobcard parameters

JOB card is used identify the job or the unit of work the operating system to
perform.
JOB card is the first statement to the JOB.
JOB card should always be coded as a first statement in the JOB.
JOB card should be coded only once in the specific JOB.
JOB card is the first control statement in the JOB.
JCL language requires JOB card to identify the particular JOB.
JOB card used to make the OS also aware of the specific JOB after
submission.
JOB card started with slashes (‘//’) in the first two positions.
JOB card can be coded in the multiple lines without having the continuation
character in the 72th column.
JOB card has the accounting information and job related information.
JOB card has multiple parameters which actually plays a key role in
identifying the account information, user information and also providing the
information about how to run the particular job.
JOB card contains JOB name, JOB operation & JOB parameters (which are
applied to the entire Job).
JOB parameters treated as global and applied to each step in JCL unless the
step has specified parameters.
JOB card syntax can be like below

//JOB-name JOB JOB-card parameters

JOB card statement can be divided into 3 parts.

1. JOB Name
2. JOB Operation
3. JOB card parameters

JOB name:
JOB name is useful to identify the job.
JOB name needs to provide at the very first in the JOB.
JOB name is of length 8 characters.
JOB name starts from 3rd character and ends at 10th character.
JOB name can be 8 characters or less than 8 characters.
JOB name can be anyone of the following.

1. Next available name in the system for PROD jobs.


2. Userid of the user who submitted the JOB.
3. Task name which will be completed by the specific JOB.

There are no specific rules to name the job.


The job names, the member name of the specific JOB are mostly same.
Refer the below example.

Example:
JOB Operation/keyword:
JOB keyword is used to identify the JOB card.
JOB keyword can only code with JOB card.
JOB keyword used to code only once in JCL because JOB card is unique for
entire JCL.
If another JOB keyword coded, then JCL language will treat it as a separate
job from the point JOB keyword coded.

Syntax:
//JOB-name JOB JOB-card parameters

JOB Card parameters:


JOB card parameters are treated as global parameters to the specific JOB.
JOB card parameters apply to each step of the JOB.
JOB card parameters can be ignore if the specific step has any parameters
defined.
If any parameter coded at step level and JOB level, the priority is step level
parameters and next JOB level parameters.
JOB card parameters can be divided into two types based on their usage.

1. Positional parameters
2. Keyword parameters.

JOB card parameters can can be explained in detail here .

Example:

JCL JOB Card Parameters


JCL Jobcard
Jobcard Positional parameters
JOB card parameters are treated as global parameters to the specific JOB.
JOB card parameters apply to each step of the JOB.
JOB card parameters can be ignore if the specific step has any parameters
defined.
If any parameter coded at step level and JOB level, the priority is step level
parameters and next JOB level parameters.
JOB card parameters can be divided into two types based on their usage.

1. Positional parameters
2. Keyword parameters.

JOB statement contains two positional parameters, also may contain over 20
keyword parameters.
We will discuss about these parameters in the next chapters.

JCL Job card Positional


parameters
Jobcard Parameters
Jobcard Keyword Parameters

The parameters which are very specific to its position in JOB card called
positional parameters.
Positional parameters information needed for OS.
Positional parameters starts immediately after JOB keyword specified.
Positional parameters starting position is 16th column after JOB keyword.
Positional parameters are mandatory.

There are two positional parameters available in JCL language.

1. Accounting information
2. Programmer name

Among the positional parameters programmer name can be bypassed by


using ‘,’ which informs the system that programmer name bypassed.
Accounting information enclosed with “()” and Programmer name enclosed
with ‘’.
Accounting information and programmer name separated by comma (,).
For positional parameters, order is very important.
Accounting information should provide first followed by programmer name.
Accounting information and programmer name are independent and not
dependent on any other.

Syntax:
//JOB-NAME JOB (ACCT-INFO),’PROGR-NAME’, Parameters

Accounting information:
Accounting information describes to whom processor time is billed.
Accounting information may be department or person.
It is purely company defined.
Most of the cases the value of Account information is number.
Accounting information can be an alphanumeric value.
Accounting information may be a combination of one or more values.
Accounting information may vary from site to site or system to system.
Accounting information is mandatory in JOB card.
Accounting information enclosed with parenthesis “()”.
Accounting information also used to calculate the usage of CPU.
User can’t able to submit a JOB without accounting information in it.

Syntax:
([account-number][,accounting-information]...)

account-number Specifies an accounting number as defined


during the installation.

accounting- Specifies more information as defined during the


information installation.

The entire accounting information parameter must not exceed 143


characters.

Override:
If providing accounting information for an individual step within a job, code an
ACCT parameter on the EXEC statement for the specific step.
Programmer name:
Programmer name is to identify who is responsible for the specific job.
Programmer name might be single person name or group name or company
name.
Programmer name is optional.
Programmer name allows the combination of alphabets and numbers.
Programmer name is immediately after the accounting information.
It is preceded by a comma after accounting information and is enclosed within
apostrophes.
Programmer name can be separated with Comma ‘,’ within apostrophes.
Programmer name can be bypassed by providing ‘ ‘.
Programmer name can be used for accounting purpose.

Syntax:
programmer's-name

Programmer’s- Specifies the owner’s name.


name
Specifies more information as defined during the
installation.

The name must not exceed 20 characters.

The name contains special characters (including blanks), other than hyphens,
leading periods, or embedded periods.
Code each apostrophe as two consecutive apostrophes. For example, code
I’ve as 'I”have'.

Example:

Simple JCL to explain different JCL statements.

=COLS> ----+----1----+----2----+----3----+----4----+----5----
+----6----+----7--
****** ***************************** Top of Data
******************************
000001 //MTHUSERR JOB (META007),'PAWAN
Y',CLASS=A,MSGCLASS=L,MSGLEVEL=(1,1),
000002 // TIME=1440,NOTIFY=&SYSUID
000005 //*
000006 //* EXAMPORG RUNNING STEP
000007 //*
000008 //STEP01 EXEC PGM=EXAMPROG
000009 //STEPLIB DD DSN=MTHUSER.TEST.LOADLIB,DISP=SHR
000010 //INPFILE DD DSN=MTHUSER.EXAMPROG.INPUT,DISP=SHR
000011 //OUTFILE DD DSN=MTHUSER.EXAMPROG.OUTPUT,
000012 // DISP=(NEW,CATLG,DELETE),
000013 // UNIT=(SYSDA,20),
000014 // SPACE=(CYL,(50,25)),
000015 // DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,BUFNO=2)
000016 //*
000017 //SYSPRINT DD SYSOUT=*
000018 //SYSUDUMP DD SYSOUT=*
000019 //SYSOUT DD SYSOUT=*
****** **************************** Bottom of Data
****************************

JCL Keyword parameters


Jobcard Positional Parameters
JCL - ADDRSPC

The parameters apart from positional parameters in JOB Statement are


called as Keyword parameters.
All Keyword parameters are optional.
Keyword parameters can be coded in any order.
Keyword parameters follow positional parameter programmer name.
Each keyword parameter separated by comma (,).
Information passed in Keyword parameters used by the JCL language.
Keyword parameters information applies to all steps in the JOB.
Keyword parameters can be specified at the JOB card or at step level.
If keyword parameter coded at both places (JOB card and step level), step
level is the first priority and next JOB card level.
Each keyword parameter is independent and not dependent on any other
parameters.
Keyword parameters are more than 20.
However the below parameters are mainly used.

• CLASS
• MSGCLASS
• MSGLEVEL
• PRIORITY
• TIME
• REGION
• TYPERUN
• NOTIFY
• RESTART
• COND
• ADDRSPC
• BYTES
• DSENQSHR
• GROUP
• JESLOG
• JOBRC
• LINES
• MEMLIMIT
• PAGES
• PASSWORD
• RD
• SECLABEL
• SCHENV
• SYSAFF
• SYSTEM
• UJOBCORR
• USER

The parameters for Cards or Tapes which are not used now a day.

The below are the list of those parameters and just provided a brief.

• CARDS - Used to specify the maximum amount of output in thousands


of bytes to be printed on cards and almost having the same functionality
as BYTES.
• CCSID - Supports data conversion on access to ISO/ANSI Version 4
tapes using access methods BSAM or QSAM, but not using EXCP

Let us discuss in detail about each parameter in further chapters.


Example:

Simple JCL to explain different JCL statements.

=COLS> ----+----1----+----2----+----3----+----4----+----5----
+----6----+----7--
****** ***************************** Top of Data
******************************
000001 //MTHUSERR JOB (META007),'PAWAN
Y',CLASS=A,MSGCLASS=L,MSGLEVEL=(1,1),
000002 // TIME=1440,NOTIFY=&SYSUID
000005 //*
000006 //* EXAMPORG RUNNING STEP
000007 //*
000008 //STEP01 EXEC PGM=EXAMPROG
000009 //STEPLIB DD DSN=MTHUSER.TEST.LOADLIB,DISP=SHR
000010 //INPFILE DD DSN=MTHUSER.EXAMPROG.INPUT,DISP=SHR
000011 //OUTFILE DD DSN=MTHUSER.EXAMPROG.OUTPUT,
000012 // DISP=(NEW,CATLG,DELETE),
000013 // UNIT=(SYSDA,20),
000014 // SPACE=(CYL,(50,25)),
000015 // DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,BUFNO=2)
000016 //*
000017 //SYSPRINT DD SYSOUT=*
000018 //SYSUDUMP DD SYSOUT=*
000019 //SYSOUT DD SYSOUT=*
****** **************************** Bottom of Data
****************************

JCL ADDRSPC
JCL - Keyword Parameters
JCL - BYTES
ADDRSPC parameter is used to indicate storage required by the system.
The storage can be virtual (not real pagable) or central (real storage and
nonpageable).
ADDRSPC parameter is an optional parameter.

Syntax:

ADDRSPC= {VIRT/REAL}

VIRT Specifies the request is for virtual storage.

The system can page the job.

REAL Specifies the request is for real/central storage.

The system cannot page the job.

Each step of the job must place on the central storage.

Default and overrides:


If no ADDRSPC parameter is specified, the default storage requested is VIRT.
The JOB statement ADDRSPC parameter applies to each step of the JOB.
If ADDRSPC parameter specifies at JOB level and EXEC level, JOB level
ADDRSPC overrides any EXEC statement ADDRSPC parameter.
Code EXEC statement ADDRSPC parameter when no ADDRSPC parameter
specified at JOB level.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', REGION=10K

This JOB statement indicates that ADDRSPC not specified. As per default
value, ADDRSPC parameter requests virtual storage. So the space available
to the job is 10K virtual storage.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', ADDRSPC=REAL, REGION=10K


This JOB statement indicates that ADDRSPC specified as REAL. ADDRSPC
parameter requests central storage. So the space available to the job is 10K
central storage.

Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', ADDRSPC=REAL

This JOB statement indicates that ADDRSPC specified as REAL. ADDRSPC


parameter requests central storage. The space available to the job is the
installation-specified default central storage.

Example 4:

//MTHEXMP4 JOB (META007),'PAWAN Y'

This JOB statement indicates that ADDRSPC not specified. As per default
value, ADDRSPC parameter requests virtual storage. The space available to
the job is the installation-specified default virtual storage.

JCL BYTES
JCL ADDRSPC
JCL - CLASS

BYTES parameter used to specify the maximum amount of output in


thousands of bytes to be printed on sysout data sets.
It also specifies the action needs to be taken when it exceeds the bytes
specified.
By using BYTES parameter, the JOB can be cancelled with or without dump
or to continue the execution by notifying operator regarding the job exceeds
the maximum.
BYTES parameter is optional.

Syntax:

BYTES={nnnnnn /([nnnnnn][,CANCEL]) /([nnnnnn][,DUMP])/([nnnnnn]


[,WARNING])}
nnnnnn Specifies the maximum amount of the output printed for
the job.

The amount is in thousands. Ex: 50 means 50000 bytes.

The value can be from 0 to 999999.

nnnnnn, Specifies that the system used to cancel the job without
CANCEL dump when output exceeds the value (nnnnnn) specified.

nnnnnn, Specifies that the system used to cancel the job when
DUMP output exceeds the value (nnnnnn) specified.

It also request the system for the dump.

nnnnnn, Specifies that the system to continue the execution of the


WARNING JOB when output exceeds the value (nnnnnn) specified.

System will issue warning messages at the specified


interval.

Default and overrides:


Specifying the BYTES parameter on JOB statement, will override the system
default values.
If no BYTES parameter specified, then system uses the installation default
value.
If no nnnnnn specified along with CANCEL, DUMP or WARNING, system
uses the installation default value.
If no CANCEL, DUMP or WARNING specified, system will use installation
default value.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y'

This JOB statement indicates that BYTES not specified. As per default value,
So the installation default determines the JOB processing.
Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', BYTES=20

This JOB statement indicates that BYTES value specified as 20. System will
cancel MTHEXMP2 job when the sysout exceeds 20 thousand bytes.

Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', BYTES=20, CANCEL

This JOB statement indicates that BYTES value specified as 20. System will
cancel MTHEXMP3 job without dump when the sysout exceeds 20 thousand
bytes.

Example 4:

//MTHEXMP4 JOB (META007),'PAWAN Y', BYTES=20, DUMP

This JOB statement indicates that BYTES value specified as 20. System will
cancel MTHEXMP4 job when the sysout exceeds 20 thousand bytes and also
requests for system dump.

Example 5:

//MTHEXMP5 JOB (META007),'PAWAN Y', BYTES=20, WARNING

This JOB statement indicates that BYTES value specified as 20. System will
continue the execution of MTHEXMP5 job when the sysout exceeds 20
thousand bytes. But send intermediate messages to the operator.

JCL CLASS
JCL - BYTES
JCL - COND

CLASS parameters used to categorize the jobs.


The categorization is either SHORT RUN jobs or LONG RUN jobs.
CLASS parameter is an optional parameter.
CLASS parameter is used to achieve good balance in the system.
CLASS parameter is used to avoid the contention between the jobs which are
using same resource.
System operations department can help to determine which job classes are
available for use.

Syntax:

CLASS=job-class

Job-class Identifies the job class

CLASS parameter value always referred with one letter.

CLASS parameter value allows alphabets (A-Z characters), numbers (0-9).


In total 36 different values can be allowed as CLASS parameter value.
CLASS parameter values predefined by system during system installation.
Every CLASS parameter value defined has its own characteristics.
CLASS definition includes number of resource constraints, usage and CPU
time etc.
The same CLASS parameter value on different JOBs usually group the jobs
based on the predefinition.

Defaults:

If job CLASS is not coded, system uses installation-defined standard default


class.

Overrides:

A JES3 //*MAIN statement CLASS parameter overrides a JOB statement


CLASS parameter.

Example:

Assume some system has defined a class parameter values are from A to Z
where A is for shortest run jobs and Z is for long run jobs.
JOB A is using B class parameter, JOB B using Z class parameter and JOB
A, JOB B are using same other parameters.

JOB A:
JOB B:

What happened if both jobs are submitted at the same time?

JOB A executes first and JOB B executes next because of the class
parameter definition.

JCL COND
JCL - CLASS
JCL - DSENQSHR

Condition parameter is used to decide execution of the JOB based on the


return code.
And also COND parameter used to specify the return code validation the
system uses to determine whether a job will continue processing or not.
COND parameter can be coded at JOB level and Step level.
COND parameter is optional parameter.
Maximum 8 conditions can be coded in single COND.
More than one condition is separated by comma (,).
If COND coded at job level and the coded condition is false, system executes
the job.
If COND coded at job level and the coded conditioned is true, system bypass
the job execution and terminates the job.
COND parameter is used to override the system default sequence of
execution.
Bypassing the job based on the return code is not equal to terminating a job
abnormally.
The COND parameter cannot have a null value.

Syntax:

COND=(return-code/RC,operator/RO)
COND=((return-code/RC,operator/RO)[,(return-code/RC,operator/
RO)]...)

RC/Return- In the above syntax, RC is the Return code of


code: precious step.

The valid RC values are from 0 to 4095.

RO/Operator: RO is the relational operator used to validate the


return code.

The valid Relational Operator is like below

Operator Meaning

GT Greater than

GE Greater than or equal to

EQ Equal to

LT Less than

LE Less than or equal to

NE Not equal to
COND= (RC, RO) is used to execute the step with COND parameter based
on the condition code returned by previous step.
If COND= (RC, RO) is true then the step with COND parameter execution will
get bypassed.
If COND= (RC, RO) is false then the step with COND parameter will get
executed.

COND Parameter Continue job Terminate job

COND=(code,GT) Code <= RC Code > RC

COND=(code,GE) Code < RC Code >= RC

COND=(code,EQ) Code ¬= RC Code = RC

COND=(code,LT) Code >= RC Code < RC

COND=(code,LE) Code > RC Code <= RC

COND=(code,NE) Code = RC Code ¬= RC

Example:

//JOB CARD
//S1 EXEC PGM=P1
//S2 EXEC PGM=P2
//S3 EXEC PGM=P3, COND=(12,NE)
//S4 EXEC PGM=P4

S2 Return code S3 Status

RC=12 Should Execute

RC <> 12 Will not Execute


JCL DSENQSHR
JCL - COND
JCL - GROUP

Specifies how the system will treat the dataset disposition changes in
between the job steps.
When a step coded with OLD, NEW or MOD on the disposition and no other
disposition coded in the further steps, system remains the exclusive control
until the end of the JOB.
When a step coded with OLD, NEW or MOD on the disposition and SHR
disposition coded in the further steps, system can change the serialization on
the data set to shared control.
The shared control allows the dataset can be shared between the jobs.
DSENQSHR is an optional parameter.
There is a DSENQSHR parameter in JOBCLASS.
JOBCLASS DSENQSHR and job DSENQSHR both are different.

Syntax:

DSENQSHR={DISALLOW|USEJC|ALLOW}

DISALLO System not allowed to change the serialization to Shared


W control.

USEJC System may change the serialization to shared control


when DSENQSHR parameter value for the JES jobclass is
AUTO.

If DSENQSHR JES jobclass parameter value is ALLOW or


DISALLOW, the system is not allowed to change the
serialization of the data set.
ALLOW System may change the serialization to shared control
when DSENQSHR parameter value for the JES jobclass is
AUTO or ALLOW.

If DSENQSHR JES jobclass parameter value is


DISALLOW, the system is not allowed to change the
serialization of the data set.

AUTO ALLOW DISALLOW

AUTO Yes Yes No

ALLOW Yes No No

DISALLOW No No No

Default and overrides:


If the JOBCLASS DSENQSHR parameter set to DISALLOW, the job
DSENQSHR specification will be ignored.
If JOBCLASS with DSENQSHR set to AUTO or ALLOW, the job DSENQSHR
specification can be used.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', DSENQSHR=ALLOW

In this example, the JOB statement specifies that for any data set allocated
for this job, the serialization may be changed to shared control and also it
depends on the DSENQSHR JES jobclass attribute value.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', DSENQSHR=USEJC

In this example, the JOB statement specifies that for any data set allocated
for this job, the serialization may be changed to shared control and also it
depends on the DSENQSHR JES jobclass attribute value.
Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', DSENQSHR=DISALLOW

In this example, the JOB statement specifies that for any data set allocated
for this job, the serialization may not be changed to shared control.

JCL GROUP
JCL DSENQSHR
JCL JESLOG

GROUP parameter is used to specify the RACF-defined group to which


RACF-user group to be connected.
RACF places each user to a specific or default group during the creating.
GROUP parameter is needed only to specify a RACF group other than users
default group.
GROUP is an optional parameter.
GROUP parameter is required when the JOB submitted by one RACF
defined user for another RACF defined user.
GROUP parameter is required when JOB executes at another network node
which uses RACF protection.

Syntax:

GROUP=group-name

Group- Specifies the user RACF-defined group.


name
Group name is 1 to 8 characters length.

Group name allows alphanumeric or national ($, #, @)


characters

First character must be alphabetic or national character.

First character must not be numeric.


Default and overrides:
If GROUP parameter is not specified and USER parameter specified, system
assigns default RACF defined group for the specified user.
If GROUP and USER parameter not specified, system will not assign any
group as group information not available in system installation exists.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', USER=MTHUSR

In this example, the JOB statement specifies the default RACF group of
MTHUSER assigned to the JOB.

Example 2:

//MTHEXMP1 JOB (META007),'PAWAN Y', GROUP=MTHGROUP

In this example, the JOB statement specifies the MTHGROUP assigned to


the JOB.

JCL JESLOG
JCL GROUP
JCL JOBRC

JESLOG parameter used to specify whether the JESLOG (JESMSGLG and


JESYSMSG) data sets should be spin-eligible.
JESLOG parameter is optional.
User can specify if they are automatically spun eligible at a particular time or
interval.

Syntax:

JESLOG= {SPIN,'hh:mm'}
{SPIN,'+hh:mm'}
{SPIN,nnn}
{SPIN,nnnK}
{SPIN,nnnM}
{NOSPIN}
{SUPPRESS}

SPIN,'hh:mm' JESLOG is spun at hh hours and mm minutes.

hh is hours value has a range of 00 through 23.

mm is minutes value has a range of 00 through


59.

SPIN,'+hh:mm' JESLOG is spun for every hh hours and mm


minutes.

hh is hours value has a range of 00 through 23.

mm is minutes value has a range of 00 through


59.

JESLOG=(SPIN,nnn JESLOG is spun when dataset has n lines.


)
JESLOG=(SPIN,nnn K is thousands.
K)
JESLOG=(SPIN,nnn M is Millions.
M)
A minimum of 500 lines must be specified.

NOSPIN JESLOG will not be spun.

SUPPRESS JESLOG will be suppressed.

Default and overrides:


If no JESLOG parameter is specified, the default value is NOSPIN.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', JESLOG=(SPIN,'+09:00')

The JESLOG parameter requests that JESLOG be spun every 9 hours.


Example 2:

//MTHEXMP1 JOB (META007),'PAWAN Y', JESLOG=(SPIN,900K)

The JESLOG parameter requests that JESLOG be spun every 900,000 lines.

JCL JOBRC
JCL JESLOG
JCL LINES

JOBRC represents the JOB Return Code.


JOBRC parameter used to control how the job return code/completion code is
set.
JOBRC is optional parameter.

Syntax:

JOBRC= {MAXRC}
{LASTRC}
{(STEP,stepname[.procstepname]}

MAXRC The job return code is set to highest


return code of any step or to the abend
code if the job fails with abend.

This is default if not specified any.

LASTRC The job return code is set to the last step


return code or abend code.
STEP,stepname[.procstep The job return code is set to the
name] stepname[.procstepname] return code or
abend code.

The last matching step return code or


abend code will be set if duplicate steps
are exists.

JCL error occurred, if step does not exist.

If the step doesn’t execute, then it follows


MAXRC for the return code.

Default and overrides:


If the parameter is not specified, the JOBCLASS sets either MAXRC or
LASTRC for the specific job.
If the sub parameter value not specified, MAXRC will be used.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y'

This specification indicates the JOBCLASS sets either MAXRC or LASTRC to


set the completion code for the job.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', JOBRC=LASTRC

This specification indicates to use the return code of the last executed step as
the completion code for the job.

Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', JOBRC=(STEP,STEP01)

Use the return code for the STEP01 step as the completion code for the job.
JCL LINES
JCL JOBRC
JCL MEMLIMIT

LINES parameter used to specify the maximum amount of output in


thousands of lines to be printed on sysout data sets.
It also specifies the action needs to be taken when it exceeds the lines
specified.
By using LINES parameter, the JOB can be cancelled with or without dump or
to continue the execution by notifying operator regarding the job exceeds the
maximum.
LINES parameter is optional.

Syntax:

LINES={nnnnnn /([nnnnnn][,CANCEL]) /([nnnnnn][,DUMP])/([nnnnnn]


[,WARNING])}

nnnnnn Specifies the maximum amount of the output printed for


the job.

The amount is in thousands. Ex: 50 means 50000 lines

The value can be from 0 to 999999.

nnnnnn, Specifies that the system used to cancel the job without
CANCEL dump when output exceeds the value (nnnnnn) specified.

nnnnnn, Specifies that the system used to cancel the job when
DUMP output exceeds the value (nnnnnn) specified.

It also requests the system for the dump.


nnnnnn, Specifies that the system to continue the execution of the
WARNING JOB when output exceeds the value (nnnnnn) specified.

System will issue warning messages at the specified


interval.

Default and overrides:


Specifying the LINES parameter on JOB statement, will override the system
default values.
If no LINES parameter specified, then system uses the installation default
value.
If no nnnnnn specified along with CANCEL, DUMP or WARNING, system
uses the installation default value.
If no CANCEL, DUMP or WARNING specified, system will use installation
default value.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y'

This JOB statement indicates LINES not specified. The installation default
determines the JOB processing.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', LINES=20

This JOB statement indicates that LINES value specified as 20. System will
cancel MTHEXMP2 job when the sysout exceeds 20 thousand lines.

Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', LINES=20, CANCEL

This JOB statement indicates that LINES value specified as 20. System will
cancel MTHEXMP3 job without dump when the sysout exceeds 20 thousand
lines.

Example 4:
//MTHEXMP4 JOB (META007),'PAWAN Y', LINES=20, DUMP

This JOB statement indicates that LINES value specified as 20. System will
cancel MTHEXMP4 job when the sysout exceeds 20 thousand lines and also
requests for system dump.

Example 5:

//MTHEXMP5 JOB (META007),'PAWAN Y', LINES=20, WARNING

This JOB statement indicates that LINES value specified as 20. System will
continue the execution of MTHEXMP5 job when the sysout exceeds 20
thousand lines. But send intermediate messages to the operator.

JCL MEMLIMIT
JCL - LINES
JCL - MSGCLASS

MEMLIMIT parameter used to specify the limit on the total number of usable
virtual pages beyond/above the bar for single address space.
MEMLIMIT is an optional parameter.

Syntax:

MEMLIMIT={nnnnnM}
{nnnnnG}
{nnnnnT}
{nnnnnP}
{NOLIMIT}
nnnnnM Specifies the 5 digit value to be used to specify the limit.
nnnnnG
nnnnnT The value can be expressed in below ways.
nnnnnP
M
Mega bytes
G
Giga bytes
T
Tera bytes
P
Peta bytes
nnnnn value can be any value in the range 0 through
99999.

The maximum value is 16384 peta bytes.

NOLIMIT Specifies there is no limit to use virtual pages above the


bar.

M Mega bytes

G Giga bytes

T Tera bytes

P Peta bytes

MEMLIMIT=0M means, the job can’t able to use virtual memory above the
bar.

Default and overrides:


If MEMLIMIT is not specified and REGION=0M, the default value is specified
by SMF.
If MEMLIMIT is not specified, the default value is NOLIMIT.
Specifying MEMLIMIT at job and exec, job MEMLIMIT overrides the exec
MEMLIMIT.
Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', MEMLIMIT=99M

This statement specifies that the job is limited to the use of 99 megabytes of
usable virtual pages above the bar.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', REGION=0M

This statement specifies that the job can’t able to use virtual memory above
the bar.

Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', REGION=NOLIMIT

This statement specifies that the job has no limit to use virtual pages above
the bar.

JCL MSGCLASS
JCL - MEMLIMIT
JCL - MSGLEVEL

MSGCLASS parameters used to describe where the JCL messages routed.


In other words, it is used to assign an output class for output listing
(SYSOUT).
MSGCLASS parameter is an optional parameter.
MSGCLASS specifies the output class for the job log.
MSGCLASS can be useful to hold the system messages output after JOB
execution completed.
MSGCLASS is related to a specific output device.
MSGCLASS is installation dependent.

Syntax:
MSGCLASS=msg-class

Syntax with JOB card:


//JOB-NAME JOB (ACCT-INFO),’PROGR-NAME’, CLASS=class-name,
MSGCLASS=msg-class, keyword-parameters

msg- Specifies the output class for job log


class
MSGCLASS parameter value always referred with one
letter.

MSGCLASS parameter value allows alphabets (A-Z


characters), numbers (0-9).

In total 36 different values can be allowed as MSGCLASS


parameter value.

MSGCLASS parameter values are predefined by system during system


installation.
Every MSGCLASS parameter value defined has its own characteristics.
Each MSGCLASS value mapped to a device or location.
MSGCLASS always has the default value (A) if it not explicitly coded.
MSGCLASS parameter value, the job log may consist below.

• Only the JOB statements.


• All job control statements.
• In-stream and/or cataloged procedure statements.
• Job control statement messages.
• JES and operator messages of the job.

Default:
The installation default is specified at JES initialization.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y',MSGCLASS=Y

In the above example, the JOB statement specifies output class “Y” for the
job log.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', MSGLEVEL=(1,0)


In the above example, the JOB statement does not specify an output class. In
this case, the output class defaults to the installation default output class for
the device from which the job was submitted.

Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', MSGCLASS=Y


//STEP1 EXEC PGM=SAMPPROG
//OUTPUT1 DD SYSOUT=Y

In the above example, the JOB statement and OUTPUT1 sysout DD


statement both specify the same output class. So the job log and data set
OUTPUT1 are written on the same output listing.

Example 4:

//MTHEXMP4 JOB (META007),'PAWAN Y', MSGCLASS=Y


//STEP1 EXEC PGM=SAMPPROG
//OUTPUT1 DD SYSOUT=*

In the above example, the JOB statement specifies output class “Y” for the
job log. The system routes sysout data set OUTPUT1 also to class “Y”
because SYSOUT=* is specified.

JCL MSGLEVEL
JCL MSGCLASS
JCL - NOTIFY

In other words, it uses to control the listing of the Job output/job log for the
specific job.
MSGLEVEL used to control the volume of the messages from server as well.
MSLEVEL is an optional parameter.
The MSGLEVEL parameter controls allocation messages and termination
messages which are printed in the job's output listing.
MSGLEVEL used to request the system for the printing of below.

1. JOB statement and all the comments.


2. All JOB control statements in the input stream.
3. In-stream and/or cataloged procedure.
4. Job control statement messages.
5. JES and operator JOB processing messages.

Syntax:

MSGLEVEL=([statements][,messages])
MSGLEVEL=(M1,M2)

Syntax with JOB card:

//JOB-NAME JOB (ACCT-INFO),’PROGR-NAME’, CLASS=class-name,


// MSGCLASS=msg-class, MSGLEVEL (M1, M2), keyword-parameters

Statements/ Specifies which job control statements to print in the


M1 statement images.

M1 parameter can be used to control the statements.

M1 parameter value range is from 0-2.

M1 is optional value.

If not specified, default value is system installation


default.

Paramet Value Description


er s

M1 0 JCL internal messages (JOB statement, all


comments and JECL statements up to the first
EXEC statement)

M1 1 All Messages (JCL statements, JES2 or JES3


control statements, the procedure statements
and messages with the values assigned to
symbolic parameters in the procedure
statements.)

M1 2 JOB related messages (JCL statements and


JES2 or JES3 control statements)
Messages/ Specifies which job control statements to print in the
M2 statement messages.

M2 parameter is used to control the messages.

M2 parameter value range is 0-1.

M2 is optional value.

If not specified, default value is system installation


default.

Paramet Value Description


er s

M2 0 Messages will be displayed only when JOB


ended abnormally

M2 1 Messages will be displayed only when JOB


ended either normally or abnormally

MSGLEVEL Description
Parameter

MSGLEVEL (0, Only JCL Internal messages when JOB ended


0) abnormally (unsuccessfully).

MSGLEVEL (0, Only JCL Internal messages when JOB ended either
1) normally or abnormally.

MSGLEVEL (1, All messages when JOB ended abnormally


0) (Unsuccessfully).
MSGLEVEL (1, All messages when JOB ended either normally or
1) abnormally.

MSGLEVEL (2, Only JOB related messages when JOB ended


0) abnormally (unsuccessfully).

MSGLEVEL (2, Only JOB related messages when JOB ended either
1) normally or abnormally.

Note:
If first sub parameter is only coded, parentheses can be ignored.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', MSGLEVEL= (1, 1)

In the above example, the JOB statement requests the system to print all
messages when JOB ended either normally or abnormally.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', MSGLEVEL=0

In the above example, the JOB statement requests that the system to print
JCL internal messages and Messages to use the installation default.

Example 3:

//MTHEXMP1 JOB (META007),'PAWAN Y', MSGLEVEL=(,0)

In the above example, the JOB statement requests the system to use the
installation default for statements and the system is not to print messages
unless the job abnormally terminates.

JCL NOTIFY
JCL - MSGLEVEL
JCL - PAGES
NOTIFY is used to send the notification of the job status when the job
completed normally or abnormally.
Identifies the user that the system to notify.
NOTIFY is optional parameter.

Syntax:

NOTIFY = &SYSUID/USERID

USERID Identifies the user that the system used to notify.

The userid is 1 through 7 alphanumeric characters.

Must be a valid TSO userid.

&SYSUI Identifies the user that the system used to notify.


D
While running the JOB, system replaces &SYSUID with the
user ID who submitted the JOB.

The system replaces &SYSUID from either the JOB


statement USER parameter or the user ID from which the
job was submitted.

&SYSUID will notify the current user who submitted the JOB.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', NOTIFY=MTHUSER

This JOB statement indicates that job completion notification sends to


MTHUSER.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y',NOTIFY=&SYSUID

This JOB statement indicates that the job completion notification sends to the
submitter of the JOB.
JCL PAGES
JCL - NOTIFY
JCL - PASSWORD

PAGES parameter used to specify the maximum amount of output in


thousands of pages to be printed on sysout data sets.
It also specifies the action needs to be taken when it exceeds the pages
specified.
By using PAGES parameter, the JOB can be cancelled with or without dump
or to continue the execution by notifying operator regarding the job exceeds
the maximum.
PAGES parameter is optional.

Syntax:

PAGES={nnnnnnnn /([nnnnnnnn][,CANCEL]) /([nnnnnnnn][,DUMP])/


([nnnnnnnn][,WARNING])}

nnnnnn Specifies the maximum amount of the output printed for


the job.

The amount is in thousands. Ex: 50 means 50000 lines

The value can be from 0 to 999999.

nnnnnn, Specifies that the system used to cancel the job without
CANCEL dump when output exceeds the value (nnnnnn) specified.

nnnnnn, Specifies that the system used to cancel the job when
DUMP output exceeds the value (nnnnnn) specified.

It also requests the system for the dump.


nnnnnn, Specifies that the system to continue the execution of the
WARNING JOB when output exceeds the value (nnnnnn) specified.

System will issue warning messages at the specified


interval.

Default and overrides:


Specifying the PAGES parameter on JOB statement, will override the system
default values.
If no PAGES parameter specified, then system uses the installation default
value.
If no nnnnnnnn specified along with CANCEL, DUMP or WARNING, system
uses the installation default value.
If no CANCEL, DUMP or WARNING specified, system will use installation
default value.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y'

This JOB statement indicates PAGES not specified. The installation default
determines the JOB processing.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', PAGES=20

This JOB statement indicates that PAGES value specified as 20. System will
cancel MTHEXMP2 job when the sysout exceeds 20 pages.

Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', PAGES=20, CANCEL

This JOB statement indicates that PAGES value specified as 20. System will
cancel MTHEXMP3 job without dump when the sysout exceeds 20 pages.

Example 4:

//MTHEXMP4 JOB (META007),'PAWAN Y', PAGES=20, DUMP


This JOB statement indicates that PAGES value specified as 20. System will
cancel MTHEXMP4 job when the sysout exceeds 20 pages and also requests
for system dump.

Example 5:

//MTHEXMP5 JOB (META007),'PAWAN Y', PAGES=20, WARNING

This JOB statement indicates that LINES value specified as 20. System will
continue the execution of MTHEXMP5 job when the sysout exceeds 20
pages. But send intermediate messages to the operator

JCL PASSWORD
JCL - PAGES
JCL - PRIORITY/PRTY

PASSWORD parameter used to identify the current RACF password.


PASSWORD parameter also used to specify the new password when the
current password expires.
Specifying new password can be done anytime but it is mandatory if the
current password expires.
PASSWORD parameter is optional.
If the installation contains the feature for propagation of user and group
identification, USER and PASSWORD parameters required in the below
cases.

• JOBs submitted by one user for another user


• JOBs executed at another network node that uses RACF protection.
• Batch job submitted through an input stream.

Do not specify the PASSWORD parameter on the started task.

Syntax:

PASSWORD=(password[,new-password])
passwor Specifies the user’s current password.
d
The password is 1 through 8 characters.

The password can be combination of alphanumeric and


national characters.

The first character must be alphabetic or national character.

passwor Specifies the user’s new password.


d
The password is 1 through 8 characters.

The password can be combination of alphanumeric and


national characters.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', PASSWORD=ABCD9,USER=MTHUSER

This JOB statement identifies ABCD9 as the current password for the RACF
user.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', PASSWORD=( ABCD9, ABCD9#),


USER=MTHUSER,GROUP=MTHGRP

This JOB statement requests that the system change the RACF password
from ABCD9 to ABCD9#.

JCL PRIORITY
JCL - PASSWORD
JCL - RD

PRTY parameter used to assign a selection priority for a JOB.


PRTY parameter controls the JOB execution by giving a specific priority to
JOB.
PRTY parameter determines the priority of JOBs within the same CLASS.
PRTY is an optional parameter.
JOB execution priority is always decided based on the CLASS category.
If two submitted JOBs have the same CLASS, then highest priority JOB
completed first and lowest priority job completed last even though lowest
priority job submitted first.
In PRTY, Highest numbers have highest priority and lowest number have
lowest priority.

Syntax:

PRTY=priority-number

Syntax with JOB card:

//JOB-NAME JOB (ACCT-INFO),’PROGR-NAME’, CLASS=class-name,


MSGCLASS=msg-class,
// MSGLEVEL (M1, M2), PRTY=priority-number, keyword-parameters

Priority- PRTY parameter value is a Numeric number with the


number range of 0-15 in JES2, 0-14 in JES3.

Higher number will have the higher priority during the


execution.

Among all the PRTY values, 15 is the highest priority in


JES2 and 14 is the highest priority in JES3.

Defaults:

JES2 job priority in the following override order:

1. A JES2 PRIORITY statement.


2. The JOB statement PRTY parameter.
3. A value calculated from the accounting information on a JES2.
4. An installation default specified at JES2 initialization.

JES3 job priority in the following override order:

1. The JOB statement PRTY parameter.


2. An installation default specified at JES3 initialization
Note:
If the specified priority in PRTY parameter is invalid, JES3 issues an error
message.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', CLASS=A, PRTY=9

In the above example, the JOB statement requests the system to set the
priority as 9 with in the class A.

Example 1:

Job A: //MTHEXMP1 JOB (META007),'PAWAN Y', CLASS=A, PRTY=9

Job B: //MTHEXMP2 JOB (META007),'PAWAN Y', CLASS=A, PRTY=11

In the above example, JOB A start executing before JOB B even though JOB
A and B submitted at the same time.

JCL RD
JCL - PRIORITY/PRTY
JCL - REGION

RD stands for restart definition.


RD parameter used to:

• Allowing JES to perform automatic step restart after the job failure even
though the journal option not specified.
• Allowing operator to perform automatic step or a check point restart if a
job failed with restartable abend code.

RD is an optional parameter.

Syntax:

RD= {R }
{RNC}
{NR }
{NC }

R Specifies Restart, check points allowed.

Indicates the operator can perform automatic restart if job fails.

RNC Specifies Restart, no check points.

Indicates the operator can perform automatic restart if job fails.

NR Specifies No Restart, Checkpoints allowed.

Indicates the operator cannot perform automatic restart if job


fails.

NC Specifies No Restart, No Checkpoints allowed.

Indicates the operator cannot perform automatic restart if job


fails.

The system can perform automatic restart if all the below are true.

• The operator authorizes to restart.


• The step to be started failed with restartable abend code.
• JOB or EXEC statement contains RD=R/RNC.

Default and overrides:


If no RD parameter specified, system uses installation default from the
jobclass during the initialization.
If RD parameter coded at JOB and EXEC, JOB RD parameter overrides
EXEC RD parameter.
Code EXEC statement RD parameter only if every step requires different RD
parameter values.
Code RD parameter at EXEC statement only if no RD parameter at JOB
statement.

Example 1:
//MTHEXMP1 JOB (META007),'PAWAN Y', RD=R

RD=R specifies that the operator can perform automatic step restart if the job
fails.

Example 2:

//MTHEXMP1 JOB (META007),'PAWAN Y', RD=RNC

RD=RNC specifies that the operator can perform automatic step restart
beginning with the step that abnormally terminates.

Example 3:

//MTHEXMP1 JOB (META007),'PAWAN Y', RD=NR

RD=NR specifies that the operator cannot perform automatic step restart or
automatic checkpoint restart.

JCL REGION
JCL - RD
JCL - RESTART

REGION parameter is used to specify the size of the central or virtual storage
required to execute the JOB.
Region parameter is an optional parameter.
REGION parameter can be coded at JOB level and Step level.
System applies the REGION parameter value to each step of the JOB.
If the REGION parameter coded at both JOB and Step level, JOB card
overrides the Step level parameter.

Syntax:
REGION = {ValueM/ValueK}
ValueK ValueK used to specify the storage in Kilo bytes.

ValueK values are 1 to 7 digit decimal numbers.

ValueK values are from 1 through 2096128 KB (2047 MB or


2 GB).

ValueK value should also be the multiples of 4.

ValueM ValueM used to specify the storage in Megabytes.

ValueM values are 1 to 4 digit decimal numbers.

ValueM values are from 1 through 2047 MB (2 GB).

ValueM value can also provide in the multiples of 4.

The maximum value can code in the JOB by using either ValueK or ValueM,
is 2GB.
If the REGION parameter coded with 0M, then it allocates the maximum
available storage below 2GB to the JOB. i.e. REGION=0M/0K specifies the
system as REGION=NOLIMIT.

Note:
If the memory provided in the REGION parameter was not sufficient to
execute the job then, the JOB abends with S422/S822.
If the region size specified is not available below 16 megabytes, the job step
abnormally ends with an ABEND822.

Overrides:

JOB statement REGION parameter applies to all steps of the job and
overrides any EXEC statement REGION parameters.

Note:
Code EXEC statement REGION parameters when each job step requires a
different region size and avoid coding JOB statement REGION parameter
when coding EXEC statement REGION parameter. Otherwise EXEC
statement REGION parameter will ignored.
Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', REGION=90K, ADDRSPC=REAL

This JOB statement indicates that the job requires 90K of central storage
because of ADDRSPC=REAL.

Example 2:

//MTHEXMP1 JOB (META007),'PAWAN Y', REGION=90K

This JOB statement indicates that the job requires 90K of virtual storage.
Because the ADDRSPC parameter is omitted, the system defaults to
ADDRSPC=VIRT.

JCL RESTART
JCL - REGION
JCL – SCHENV

RESTART is used to restart the execution from a particular step.


The step can be JOB step, procedure step or a check point.
Normally RESTART parameter will be used to start execution of a particular
step from where it’s got abended.
Restarts can be of two types:

• Restarting at the beginning of a job step(Deferred step restart).


• Restarting from a checkpoint taken during step execution by a CHKPT
macro instruction (Deferred checkpoint restart).

Syntax:

RESTART = [stepname.]procname
(or)
RESTART = *
* Indicates to specify the job execution starts from step1.

The step can be job first step or procedure first step if the
EXEC calling any procedure.

Stepnam Indicates the step where the execution starts from during
e the restart.

If the step name refers procedure, then the step name in


the procedure must be specified.

Procnam Indicates the procedure name in which procedure the


e RESTART step existed.

JOB starts execution from the first step of the JCL by


default.

If restart step is different from first step of procedure, then


user need to specify the step name in the procedure.

If no RESTART coded in the job, the execution will start from the beginning.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', RESTART=*


//STEP01 EXEC PROG=A
.
.
//STEP02 EXEC PROG=B

This JOB statement indicates that job needs to start execution from STEP01.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', RESTART=STEP02


//STEP01 EXEC PROG=A
.
.
//STEP02 EXEC PROG=B

This JOB statement indicates that job needs to start execution from STEP02.
Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', RESTART=STEP02.PROCB


//STEP01 EXEC PROG=A
.
.
//STEP02 EXEC PROCB

//PROCB
//STEP01 EXEC PROG=B
.
.
//STEP02 EXEC PROG=C

This JOB statement indicates that job needs to start execution from STEP01
of PROCB.

Example 4:

//MTHEXMP3 JOB (META007),'PAWAN Y', RESTART=STEP02.PROCB.STEP02


//STEP01 EXEC PROG=A
.
.
//STEP02 EXEC PROCB

//PROCB
//STEP01 EXEC PROG=B
.
.
//STEP02 EXEC PROG=C

This JOB statement indicates that job needs to start execution from STEP02
of PROCB.

JCL SCHENV
JCL - RESTART
JCL – SECLABEL

SCHENV parameter used to specify the Workload Manager (WLM)


scheduling environment to which the current job is associated with.
Scheduling environment is a list of resources and their required settings.
If a job is associated with scheduling environment, user must ensure that the
job scheduled only for running on a system which satisfies the requirements
of job.
SCHENV mostly used in PRODUCTION jobs.
SCHENV is an optional parameter.
Do not specify the SCHENV parameter for a started task.

Syntax:

SCHENV=schenv-name

schenv- Specifies the name of WLM scheduling environment


name associated with JOB.

Scheduled environment name is 1 through 16 characters.

Scheduled environment name can be combination of


alphanumeric, national characters and _.

If _(underscore) used, then schenv-name should be


specified in single quotes.

Default and overrides:


If SCHENV not specified, the JOB will not associate with any of the
scheduled environment.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', SCHENV=MTHENV

MTHEXMP1 is associated with the MTHENV scheduling environment.

JCL SECLABEL
JCL – SCHENV
JCL – SYSAFF
SECLABEL parameter used to specify the security level at which the job is to
execute when submitted.
SECLABLE represents the security level and categories defined to RACF.
User must have authority and required privileges granted by system
administrator to run under specific security level specified in job.
The SECLABLE is optional parameter.
Do not specify SECLABEL parameter for a started task.

Syntax:

SECLABEL=sec-label-name

Sec-label- Specifies the security label name defined by system


name administrator during installation.

Security label name is 1 through 8 characters.

Security label name can be combination of alphanumeric


and national characters.

The first character should be non-numeric.

Default and overrides:


If SECLABEL parameter is not specified, then system uses the system
default security label for the user RACF.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', SECLABEL=MTHLBL

MTHEXMP1 executes at a security level defined for security label MTHLBL.

JCL SYSAFF
JCL – SECLABEL
JCL – SYSTEM
SYSAFF used to specify the JES2 members and JES3 systems that are
eligible to process the job.
SYSAFF representing system similarity.
SYSAFF is an optional parameter.
Upt0 33 names can be specified with SYSAFF parameter.

Syntax:

SYSAFF={MemberName}
{-MemberName}
{(MemberName,MemberName, ...,MemberName)}
{(-MemberName,MemberName, ...,MemberName)}
{(MemberName,...,IND)}
{(-MemberName,...,IND)}
{ANY}
{(ANY,IND)}

MemberNam Specifies up to 33 JES2/JES3 names can be specified.


e
The name is 1-4 character valid JES2 member names
and 8-character JES3 system names.

-- Specifies up to 33 JES2/JES3 names can be specified.


MemberNam
e The name is 1-4 character valid JES2 member names
and 8-character JES3 system names.

A - (minus character) preceding a member or system


name indicates that member ( JES2 member or JES3
system) is not eligible for processing the job.

A - (minus character) preceding the first member or


system name in a list indicates that none of members or
systems in the list are eligible for processing the job.

ANY Specifies any system that satisfies the job's


requirements.
IND Specifies JES2 to use system scheduling in
independent mode after any other SYSAFF parameters.

The sub parameters must be enclosed in parentheses if


IND is specified.

JES3 ignores the IND value if it is not a valid JES3


system name.

Default and overrides:


If SYSAFF not specified, The default system set from SYSAFF associated
input devices in JES2 and default system set from JOBCLASS.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', SYSAFF=(MTH1,MTH2)

The systems represented by member names MTH1 and MTH2 are eligible for
processing the job.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', SYSTEM=(MTH1,*,MTH2)

The systems represented by member names MTH1, MTH2 and the system
that submitted the job is eligible for processing the job.

Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', SYSTEM=(-MTH1,*,MTH2)

The systems represented by member names MTH1 and MTH2 and the
system that submitted the job are not eligible for processing the job.

Example 4:

//MTHEXMP3 JOB (META007),'PAWAN Y', SYSAFF=ANY

Any JES2 member or JES3 system in the JESplex that satisfies the job's
requirements are eligible to process the job.
JCL SYSTEM
JCL - SYSAFF
JCL - TIME

SYSTEM used to specify the eligible systems to process the job.


SYSTEM parameter represents the system affinity.
32 system names can be coded with SYSTEM parameter.
SYSTEM is an optional parameter.

Syntax:

SYSTEM={SystemName}
{-SystemName}
{(SystemName,SystemName, ...,SystemName)}
{(-SystemName,SystemName, ...,SystemName)}
{ANY}}
{JGLOBAL}
{JLOCAL}

SystemNa Specifies up to 32 names can be provided.


me
The name is 1-8 character system names.

A value of * (asterisk) indicates any system name that


submitted the job.
-- Specifies up to 32 names can be provided.
SystemNa
me The name is 1-8 character system names.

A value of * (asterisk) indicates any system name that


submitted the job.

A minus character (-) preceding a system name indicates


the system is not eligible for processing the job.

A minus character (-) preceding the first system name in


a list indicates that none of the systems listed are eligible
for processing the job.

ANY Specifies any system name that satisfies the job


requirements.

JGLOBAL Specifies that the job is to run on the JES3 global


processor only.

JLOCAL Specifies that the job is to run on a JES3 local processor


only.

Default and overrides:


If SYSTEM not specified, The default system set from SYSAFF associated
input devices in JES2 and default system set from JOBCLASS.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', SYSAFF=(MTHSYS1,MTHSYS2)

The systems MTHSYS1 and MTHSYS2 are eligible for processing the job.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', SYSTEM=(MTHSYS1,*,MTHSYS2)


The systems MTHSYS1, MTHSYS2 and the system that submitted the job is
eligible for processing the job.

Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', SYSTEM=(-MTHSYS1,*,MTHSYS2)

The systems MTHSYS1 and MTHSYS2 and the system that submitted the
job are not eligible for processing the job.

Example 4:

//MTHEXMP3 JOB (META007),'PAWAN Y', SYSAFF=ANY

Any system in the JESplex that satisfies the job's requirements are eligible to
process the job.

JCL TIME
JCL – SYSTEM
JCL - TYPERUN

TIME parameter specifies the maximum amount of time that job may use the
processor.
In other words, TIME specifies the maximum CPU usage time allowed for the
JOB to execute.
TIME parameter is optional parameter.
TIME parameter can be coded at the JOB level and step level too.
System will automatically cancel the JOB execution, if the execution time
reaches to the TIME specified.
In other words, TIME parameter will notify the maximum CPU utilization time
to OS and once the specified time utilized by the job, OS will automatically
cancel the job.
If TIME parameter not specified, then the default value is 1440 min/24 Hours/
1 day.
Default time in TIME parameter can vary system to system based on
installation/setup.
If the TIME parameter value is less than the default value from the system
installation, TIME parameter can be used on JOB statement.
If the TIME parameter value is greater than the default value from the system
installation, TIME parameter can’t be used on JOB statement.
If the TIME parameter value is greater than the default value from the system
installation, TIME parameter can be used on EXEC statement.

Syntax:

TIME= {([minutes][,seconds])}
{1440 }
{NOLIMIT }
{MAXIMUM }

NOLIMIT or 1440:

NOLIMIT or 1440 Minutes values are almost functionally same.


Both specify that the job can use the processor for unlimited time.
In other words, both assign unlimited time for the JOB execution.
1440 means 24 hours.
If NOLIMIT or 1440 Minutes specified at JOB card level, all TIME parameters
specified at step level will be overwritten.
If NOLIMIT or 1440 coded, the system will allow waiting the particular JOB
step more than the default time specified during the system installation.

MAXIMUM:

Specifies the JOB can use the processor for the maximum amount of time.
If MAXIMUM coded in TIME parameter, JOB can use 248.55 days (357912
minutes) processor time.

Minutes:
Specifies the JOB can use the processor for the maximum amount of
minutes.
Minutes must be a number from 0 through 357912 (248.55 days).
Any number between 0 through 357912 (248.55 days) should be coded with
TIME parameter, the system allows that many minutes to use the processor.
If ZERO specified in TIME parameter, it may produce unpredictable results.

Seconds:
Specify the JOB can use the processor for that many seconds in addition to
the minutes specified.
Seconds always specifies along with the Minutes.
Seconds must be a value in between 0 to 59 seconds.

Note:
If the TIME provided in JOB is not sufficient to execute, then JOB will fail with
the abend code S322.

Defaults:

If TIME parameter not specified on the JOB statement, the time limit for each
job step is:

• EXEC statement TIME parameter value


• The default time limit, if not specified on EXEC statement.

Overrides:

If the JOB statement TIME parameter coded as TIME=NOLIMIT or


TIME=1440, the system nullifies any TIME parameters on EXEC statements
as well as the default TIME values.
All steps within the job will have unlimited processor time.

If the JOB statement TIME parameter coded other than TIME=NOLIMIT or


TIME=1440, the system sets the time limit for each step as below.

1. If the EXEC statement TIME parameter coded, system will pick smaller
one among EXEC statement TIME parameter value and the time
remaining after execution of previous steps from JOB statement TIME
parameter value.
2.
3. If the EXEC statement TIME parameter not coded, system will pick
smaller one among default time limit value and the time remaining after
execution of previous steps from JOB statement TIME parameter value.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', CLASS=A, TIME=1140

In the above example, the TIME statement can specify that the job can use
the processor for unlimited time.

Example 2:

//MTHEXMP2 JOB (META007),'PAWAN Y', CLASS=A, TIME=(9,30)

In the above example, the TIME statement can specify that the job can use
the processor for 9 minutes and 30 seconds.
Example 3:

//MTHEXMP3 JOB (META007),'PAWAN Y', CLASS=A, TIME=(,45)

In the above example, the TIME statement can specify that the job can use
the processor for 45 seconds.

Example 4:

//MTHEXMP4 JOB (META007),'PAWAN Y', CLASS=A, TIME=MAXIMUM

In the above example, the TIME statement can specify that the job can use
the processor for 248.55 days (357912 minutes).

Example 5:

//MTHEXMP1 JOB (META007),'PAWAN Y', TIME=6


//STEP01 EXEC PROG=A,TIME=2
.
.
//STEP02 EXEC PROG=B,TIME=6

In the above example, the STEP01 should complete in 2 minutes as the


minimum of 6 and 2 is 2.
STEP02 should complete in 4 minutes max as the minimum of 6 and 4 (JOB
TIME value – STEP01 TIME value) is 4.
If any of the above step executing beyond the time calculated, then the job
will terminates abnormally.

JCL TYPRUN
JCL - TIME
JCL – UJOBCORR

TYPRUN is used request for a special job processing like scanning JOB for
syntax errors etc.
TYPRUN is optional parameter.
TYPRUN used to specify for the JOBs which are not started.
If the TYPRUN specified for the submitted JOB, the JOB will fail.
Syntax:

TYPRUN= {SCAN }
{HOLD }
{JCLHOLD}
{COPY }

Scan SCAN used to check the syntax errors without


executing the JOB.

SCAN just check for syntax errors without allocating


devices.

SCAN used to check for:

1. Spelling of parameter keywords.


2. Invalid characters.
3. Unbalanced parentheses.
4. Misplaced positional parameters.
5. Invalid syntax on JCL statements in cataloged
procedures.

While using SCAN, System does not check the below

1. Misplaced statements
2. JCL sub parameters syntax
3. Inappropriate parameter or sub parameters
together.

COPY & RUN & JCLHOLD is the options available in JES2


JCLHOLD only.
Hold Requests the system to hold the JOB until the operator
releases the JOB.

JOB will be in held until the operator explicitly releases


it.

HOLD option is very useful when testing series of


JOBs.

By default, the job will take it as RUN.

Example 1:

//MTHEXMP1 JOB (META007),'PAWAN Y', TYPRUN=SCAN

Once the job submitted, it will scan all the syntactical errors first. If any errors
detected, the JOB fails with errors.

Example 2:

Job A:

//MTHEXMP1 JOB (META007),'PAWAN Y'


//STEP01 EXEC PROG=A
//DD01 DD MTH.INPUT.DATA,DISP=SHR

Job B:

//MTHEXMP2 JOB (META007),'PAWAN Y', TYPRUN=HOLD


//STEP01 EXEC PROG=B
//DD01 DD MTH.INPUT.DATA,DISP=SHR

JOB A and JOB B submitted at the same time for execution. Both jobs are
using the same input. But JOB B needs to use the DD01 file after JOB A
completes.

So JOB A submitted directly without any TYPRUN parameter and JOB B with
TYPRUN=HOLD to put the job in HOLD. Once the JOB A completed, the
operator should release the JOB B for execution.

JCL UJOBCORR
JCL - TYPERUN
JCL - USER

UJOBCORR used to specify user portion of job correlator.


Job correlator is a 64 bit unique key used to identify the job to JES.
JOBCORR is a combination of system generated value and user specified
value.
In JOBCORR, first 32 bytes are system generated value and next 32 bytes
are the user portion.
UJOBCORR is an optional parameter.

Syntax:

UJOBCORR={user-correlator}

Userid Specifies the userid of the current job submitter.

The userid is 1 through 8 characters.

The userid can be combination of alphanumeric and national characte

The first character must be alphabetic or national character.


User- User-correlator name is 1 through 32 characters.
correlator
User-correlator name can be combination of
alphanumeric, national characters and _.

If _(underscore) used, then User-correlator should be


specified in single quotes.

The User-correlator name must be start with alphabetic or


national character.

A value of * (asterisk) indicates any ujobcorr name that


submitted the job.

Example:

//MTHEXMP1 JOB (META007),'PAWAN Y', UJOBCORR=’MTH_EXAMPLE'

The user portion of the job correlator is set to MTH_EXAMPLE.

JCL USER
JCL - UJOBCORR
JCL EXEC Statement

USER parameter used to identify the submitter of the job by the system.
USER is an optional parameter.
Userid is used by RACF and other system components.
If the installation contains the feature for propagation of user and group
identification, USER and PASSWORD parameters required in the below
cases.

• JOBs submitted by one user for another user


• JOBs executed at another network node that uses RACF protection.
• Batch job submitted through an input stream.

Syntax:
USER=[(]userid[)]

Userid Specifies the userid of the current job submitter.

The userid is 1 through 8 characters.

The userid can be combination of alphanumeric and national


characters.

The first character must be alphabetic or national character.

Default and overrides:


When required and USER parameter not specified, RACF assigns a default
user id and group id.

Example:

//MTHEXMP1 JOB (META007),'PAWAN Y', USER=MTHUSER,PASSWORD=ABCD9

This statement identifies the user MTHUSER submitting this job.

JCL EXEC Statement


JCL - USER
JCL - EXEC ACCT

Before proceding with EXEC statement, Refer the JCL Coding sheet topic.

EXEC statement used to identify the program or procedure (catalogue or


instream) to execute at the specific job step.
EXEC statement also informs the system how to process the job step.
EXEC statements have details of the program/procedure to be executed.
EXEC keyword should start at 12th column and should end at 15th column.
EXEC statement is required for each job step.
EXEC statement treats as a beginning of the step in JCL or procedure.
JCL contains maximum 255 steps.
Job step is a combination of multiple JCL statements which are starts with //.
Step can be ended with null statement (‘//’) or starting of another step.
Syntax:

//[stepname] EXEC positional-parm[,keyword-parm]..[,symbolic-


parm=value]..[comments]

EXEC statement can be divided into the below parts.

1. Step name
2. Operation
3. Parameters
4. Comment

Step name:
Step name is optional.
If the step name is needed, then step name must be unique in the entire job.
Step name must be unique among the procedures which are called by the
same job.
If the step names are not unique and submitted the job, then the results might
be unpredictable.

Rules:

Step name should be starts from 3rd column.


Step name is 1 through 8 characters.
Step name is a combination of alphanumeric and national characters (@,#
and $).
Step name first character should be alphabetic or national character.
Step name must be followed by one blank before EXEC.

Operation:
Operation field describes about the type of operand.
Operation field consists of EXEC characters.
Operation field is of length 4 characters.
Operation field can start in any column.
Operation field is mandatory with every step name.
Operation field must be followed by one blank.

Parameters:
EXEC statement has three types of parameters.

• Positional parameters
• Keyword parameters
• Symbolic parameters

Positional parameter (positional-parm):

EXEC statement must contain positional parameters.


The EXEC statement may contain one or more positional parameters.
Positional parameter must start after EXEC statement and before keyword
parameters.
Positional parameters can start in any column.
Positional parameters are optional even though operation field is specified.
EXEC statement has two positional parameters.

Positional Parameter Purpose

PGM Specifies program name system is to execute

PROC Specifies procedure name system is to


execute

Keyword parameters (keyword-parm):

EXEC statement can be coded with keyword parameters.


The keyword parameters are from the JOB statement.
The EXEC statement can contain one or more keyword parameters with it.
EXEC statement keyword parameters are less in count when compared with
job statement keyword parameters.
Below keyword parameters are used with EXEC statement.

Keyword Purpose
Parameter

ACCT Specifies accounting information


ADDRSPC Specifies the type of the storage required for the step

COND Specifies the return code tests used to determine the


specific step execution

MEMLIMIT Specifies the limit on total number of usable virtual


pages above the bar

RD Specifies the user authority for automatic restart

REGION Specifies the Maximum amount of space required by


the step

TIME Specifies the Maximum amount of processor time the


step can use

The below are the list of keyword parameter which are not part of JOB
statement and only applicable for EXEC statement.

Keyword Parameter Purpose

DYNAMNBR Holds the number of dataset allocations for


reuse

PARM Used to pass the input data to the program

If EXEC statement executes any instream or cataloged procedure, all the


keyword parameters in the instream or catalogued procedure will be
overridden by the values of keyword parameters coded with EXEC statement.
If only one keyword parameter at a particular step in the in-stream or
cataloged procedure needs to be overridden by the EXEC statement keyword
parameter, then code like below.

Keyword. Proc-step-name=value

Example:
//STEP1 EXEC PROC=MTHPROC, REGION.PROCSTP2=10K

The REGION 10K applies to the only step PROCSTP2 in the procedure
MTHPROC.

Symbolic parameters (symbolic-parm=value):

EXEC statement can code with symbolic parameters.


EXEC statement can assign values to, or nullify, symbolic parameters.

Comment:
Comment used to make a note of current statement.
Comment field follows parameter field.
Comment field should be preceded with a blank after the parameter field.

Example 1:

//STEP1 EXEC PGM=SAMPLE,PARM='mainframestechhelp'

The EXEC statement named STEP1 invokes a program named SAMPLE and
passes the value in the PARM parameter to SAMPLE.

Example 2:

// EXEC PGM=SAMPLE,REGION=2K

This EXEC statement without a step name invokes a program named


SAMPLE and specifies the maximum space for execution of the step.

Example 3:

//STEP1 EXEC PROC=MTHPROC,RD.STEP2=RNC

The EXEC statement named STEP1 invokes a procedure named STEP1. RD


parameter overrides/applies to only the step named STEP2.

JCL EXEC ACCT


JCL - EXEC Statement
JCL - EXEC ADDRSPC
ACCT parameter used to specify accounting information subparameters that
apply to the step.
The subparameters can be one or more.
The system passes this subparameters information to the installation
accounting routines.

Syntax:

ACCT[.procstepname]=(accounting-information)

[.procstepna Procedure step-name containing ACCT to be affected


me]

accounting- Specifies one or more subparameters of accounting


information information as defined by the installation

The entire accounting information must not exceed


142 characters including commas etc,.

When multiple subparameters, separate them by a comma and whole text


enclosed with parentheses or apostrophes.
If any special characters specified, whole text should enclosed with
parentheses or apostrophes.
If continuation to another line, whole text should enclosed with parentheses.

Example 1:

//STEP01 EXEC PGM=SAMPLE,ACCT=(ACCT7)

This EXEC statement executes program SAMPLE and specifies accounting


information for this job step.

Example 2:

//STEP02 EXEC PROC=MTHPROC,ACCT=('/007/')

This EXEC statement calls cataloged or in-stream procedure MTHPROC.


The accounting information applies to the STEP02 and to all the steps in
procedure MTHPROC.
Example 3:

//STEP03 EXEC PROC=MTHPROC,ACCT.STEPZ=('/007/')

This EXEC statement calls cataloged or in-stream procedure MTHPROC.


The accounting information applies to the STEP03 and to STEPZ in
procedure MTHPROC.

JCL EXEC ADDRSPC


JCL - EXEC ACCT
JCL - EXEC COND

ADDRSPC parameter is used to indicate storage required by the system for


the job step.
The storage can be virtual (not real pagable) or central (real storage and
nonpageable).
ADDRSPC parameter is an optional parameter.

Syntax:

ADDRSPC= {VIRT/REAL}

VIRT Specifies the request is for virtual storage.

The system can page the job step.

REA Specifies the request is for real/central storage.


L
The system cannot page the job step and step of the job must
place on the central storage.

Default and overrides:

If no ADDRSPC parameter is specified, the default storage requested is VIRT.


The JOB statement ADDRSPC parameter applies to each step of the JOB.
If ADDRSPC parameter specifies at JOB level and EXEC level, JOB level
ADDRSPC overrides any EXEC statement ADDRSPC parameter.

Code EXEC statement ADDRSPC parameter when no ADDRSPC parameter


specified at JOB level.

Example 1:

//STEP01 EXEC PGM=SAMPLE,REGION=10K

This EXEC statement indicates that ADDRSPC not specified. As per default
value, ADDRSPC parameter requests virtual storage. So the space available
to the step is 10K virtual storage.

Example 2:

//STEP02 EXEC PGM=SAMPLE,ADDRSPC=REAL,REGION=10K

This EXEC statement indicates that ADDRSPC specified as REAL.


ADDRSPC parameter requests central storage. So the space available to the
step is 10K central storage.

Example 3:

//STEP03 EXEC PGM=SAMPLE,ADDRSPC=REAL

This EXEC statement indicates that ADDRSPC specified as REAL.


ADDRSPC parameter requests central storage. The space available to the
step is the installation-specified default central storage.

Example 4:

//STEP04 EXEC PGM=SAMPLE

This EXEC statement indicates that ADDRSPC not specified. As per default
value, ADDRSPC parameter requests virtual storage. The space available to
the step is the installation-specified default virtual storage.

JCL EXEC COND


JCL - EXEC ADDRSPC
JCL - EXEC DYNAMNBR
Condition parameter is used to decide execution of the JOB step based on
the return code.
And also COND parameter used to specify the return code validation the
system uses to determine whether a job step will continue processing or not.
COND parameter can be coded at JOB level and Step level.
COND parameter is optional parameter.
Maximum 8 conditions can be coded in single COND.
More than one condition is separated by comma (,).
If COND coded at step level and the coded condition is false, system
executes the step.
If COND coded at step level and the coded conditioned is true, system
bypass the step execution and terminates the job.
COND parameter is used to override the system default sequence of
execution.
Bypassing the step based on the return code is not equal to terminating a
step abnormally.
The COND parameter cannot have a null value.

Syntax:

COND[.procstepname] = (return-code,operator)
COND[.procstepname] = ((return-code,operator[,stepname]
[.procstepname])
[,(return-code,operator[,stepname][.procstepname])]... [,EVEN])
[,ONLY]
COND=EVEN
COND=ONLY

RC/Return- In the above syntax, RC is the Return code of


code precious step.

The valid RC values are from 0 to 4095.

RO/Operator RO is the relational operator used to validate the


return code.

The valid Relational Operator is like below


[.procstepnam Procedure step-name containing ACCT to be
e] affected

Step-name Specifies the step-name of the RC validated.

Operator Meaning

GT Greater than

GE Greater than or equal to

EQ Equal to

LT Less than

LE Less than or equal to

NE Not equal to

COND parameter divided into four types based on its usage.

1. COND=ONLY
2. COND=EVEN
3. COND= (Rc,Ro)
4. COND= (Rc,Ro,Stepname)

COND=ONLY:
ONLY parameter used to execute the step with COND parameter when the
previous step execution is unsuccessful.
If the previous step execution result is abnormal then the subsequent step
must get executed.
If the previous step execution result is normal then the subsequent step must
get executed.

Syntax:
COND=ONLY

Below table representing the various possible scenarios based on the


different input.

Operator Previous Step Status Current Step Status

ONLY Not Executed Will execute

ONLY Executed Will not execute

Example:

//JOB CARD
//S1 EXEC PGM=P1
//S2 EXEC PGM=P2
//S3 EXEC PGM=P3, COND=ONLY
//S4 EXEC PGM=P4

Below table shows the possible output scenarios.

S2 Status S3 Status

Executed Will not execute

Not Executed Will execute

COND=EVEN:
EVEN parameter used to execute step with COND parameter when the
previous step execution is successful/unsuccessful.
If the previous step execution result is normal/abnormal then the current step
must get executed.
COND=EVEN ignores the previous step return code and executes the current
step always.

Syntax:
COND=EVEN

Below table representing the various possible scenarios based on the


different input.

Operator Previous Step Status Current Step Status

EVEN Not Executed Will execute

EVEN Executed Will execute

Example:

//JOB CARD
//S1 EXEC PGM=P1
//S2 EXEC PGM=P2
//S3 EXEC PGM=P3, COND=EVEN
//S4 EXEC PGM=P4

Below table shows the possible output scenarios.

S2 Status S3 Status

Executed Will execute

Not Executed Will execute

COND= (RC, RO):


COND= (RC, RO) is used to execute the step with COND parameter based
on the condition code returned by previous step.
If COND= (RC, RO) is true then the step with COND parameter execution will
get bypassed.
If COND= (RC, RO) is false then the step with COND parameter will get
executed.

Syntax:
COND[.procstepname] = (return-code,operator)

return-code/RC:
In the above syntax, Rc is the Return code of precious step.
The valid RC values are from 0 to 4095.
operator/RO:
RO is the relational operator used to validate the return code.
The valid Relational Operator is like below

Operator Meaning

GT Greater than

GE Greater than or equal to

EQ Equal to

LT Less than

LE Less than or equal to

NE Not equal to

Below table representing the various possible scenarios based on the


different input.

COND Parameter Continue job Terminate job

COND=(code,GT) Code <= RC Code > RC

COND=(code,GE) Code < RC Code >= RC

COND=(code,EQ) Code ¬= RC Code = RC

COND=(code,LT) Code >= RC Code < RC


COND=(code,LE) Code > RC Code <= RC

COND=(code,NE) Code = RC Code ¬= RC

Example:

//JOB CARD
//S1 EXEC PGM=P1
//S2 EXEC PGM=P2
//S3 EXEC PGM=P3, COND=(12,NE)
//S4 EXEC PGM=P4

Below table shows the possible output scenarios.

S2 RC=12 S3 Should Execute

S2 RC<> 12 S3 Will not Execute

COND= (RC, RO, Stepname):


COND= (RC, RO, Stepname) is used to execute the step with COND
parameter based on the condition code returned by specified step name in
COND.
If COND= (RC, RO, Stepname) is true then the step with COND parameter
execution will get bypassed.
If COND= (RC, RO, Stepname) is false then the step with COND parameter
will get executed.
This COND parameter will be used to validate the particular step return code
but not previous step.
Syntax:

COND[.procstepname] = (return-code,operator[,stepname]
[.procstepname])

return-code/RC:
In the above syntax, Rc is the Return code of precious step.
The valid RC values are from 0 to 4095.
operator/RO:
RO is the relational operator used to validate the return code.
The valid Relational Operator is like below

Operator Meaning

GT Greater than

GE Greater than or equal to

EQ Equal to

LT Less than

LE Less than or equal to

NE Not equal to

Below table representing the various possible scenarios based on the


different input.

COND Parameter Continue job Terminate job

COND=(code,GT,step- Code <= step- Code > step-


name) name.RC name.RC

COND=(code,GE,step- Code < step- Code >= step-


name) name.RC name.RC

COND=(code,EQ,step- Code ¬= step- Code = step-


name) name.RC name.RC

COND=(code,LT,step- Code >= step- Code < step-


name) name.RC name.RC
COND=(code,LE,step- Code > step- Code <= step-
name) name.RC name.RC

COND=(code,NE,step- Code = step- Code ¬= step-


name) name.RC name.RC

Example:

//JOB CARD
//S1 EXEC PGM=P1
//S2 EXEC PGM=P2
//S3 EXEC PGM=P3, COND=(12,EQ,S1)
//S4 EXEC PGM=P4

Below table shows the possible output scenarios.

S2 RC=12 S3 Will not Execute

S2 RC<> 12 S3 Should Execute

JCL EXEC DYNAMNBR


JCL - EXEC COND
JCL - EXEC MEMLIMIT

DYNAMNBR parameter used to specify to the system to hold the number of


resources for reuse.
DYNAMNBR parameter can be coded instead of several DD statements with
DYNAM parameter.
DYNAMNBR is an optional parameter.

Syntax:

DYNAMNBR[.procstepname]=n
n Specifies the number to calculate maximum number of dataset
allocation for reuse.

The value is from 0 through 3273 minus the number of DD


statements at the specified step.

Defaults and Overrides:


If no DYNAMNBR parameter is coded, the default is 0.
If DYNAMNBR coded incorrectly, the system uses the default of 0 and issues
a JCL warning message.

Example 1:

//STEP01 EXEC PGM=SAMPLE,DYNAMNBR=9

In the above example, the DYNAMNBR statement can specify that the
system should hold the data set allocations for reuse are: 9 minus the number
of DD statements following this EXEC statement.

Example 2:

//STEP01 EXEC PROC=MTHPROC,DYNAMNBR.STEP02=9

This EXEC statement calls the cataloged or instream proc MTHPROC.


DYNAMNBR.STEP02 specifies that the step STEP02 in the MTHPROC can
specify that the system should hold the data set allocations for reuse are: 9
minus the number of DD statements following STEP02 EXEC statement.

JCL EXEC MEMLIMIT


JCL - EXEC DYNAMNBR
JCL - EXEC RD

MEMLIMIT parameter used to specify the limit on the total number of usable
virtual pages beyond/above the bar for single address space for the step.
MEMLIMIT is an optional parameter.
Syntax:

MEMLIMIT={nnnnnM}
{nnnnnG}
{nnnnnT}
{nnnnnP}
{NOLIMIT}

nnnnnM Specifies the 5 digit value to be used to specify the limit.


nnnnnG
nnnnnT The value can be expressed in below ways.
nnnnnP
M
Mega bytes
G
Giga bytes
T
Tera bytes
P
Peta bytes

nnnnn value can be any value in the range 0 through


99999.

The maximum value is 16384 peta bytes.

NOLIMIT Specifies there is no limit to use virtual pages above the


bar.

M Mega bytes

G Giga bytes

T Tera bytes

P Peta bytes

MEMLIMIT=0M means, the step can’t able to use virtual memory above the
bar.
Default and overrides:
If MEMLIMIT is not specified and REGION=0M, the default value is specified
by SMF.
If MEMLIMIT is not specified, the default value is NOLIMIT.
Specifying MEMLIMIT at job and exec, job MEMLIMIT overrides the exec
MEMLIMIT.

Example 1:

//STEP01 EXEC PGM=SAMPLE,MEMLIMIT=99M

This statement specifies that the step is limited to the use of 99 megabytes of
usable virtual pages above the bar based on the other job and installation
factors.

Example 2:

//STEP02 EXEC PGM=SAMPLE,REGION=0M

This statement specifies that the step can’t able to use virtual memory above
the bar.

Example 3:

//STEP03 EXEC PGM=SAMPLE,REGION=NOLIMIT

This statement specifies that the step has no limit to use virtual pages above
the bar.

JCL EXEC RD
JCL - EXEC MEMLIMIT
JCL - EXEC REGION

RD stands for restart definition.


RD parameter used to:
• Allowing JES to perform automatic step restart after the step failure
even though the journal option not specified.
• Allowing operator to perform automatic step or a check point restart if a
step failed with restartable abend code.

RD is an optional parameter.

Syntax:

RD[.procstepname]= {R }
{RNC}
{NR }
{NC }

R Specifies Restart, check points allowed.

Indicates the operator can perform automatic restart if step


fails.

RNC Specifies Restart, no check points.

Indicates the operator can perform automatic restart if step


fails.

NR Specifies No Restart, Checkpoints allowed.

Indicates the operator cannot perform automatic restart if step


fails.

NC Specifies No Restart, No Checkpoints allowed.

Indicates the operator cannot perform automatic restart if step


fails.

The system can perform automatic restart if all the below are true.

• The operator authorizes to restart.


• The step to be started failed with restartable abend code.
• EXEC statement contains RD=R/RNC.
Default and overrides:
If no RD parameter specified at EXEC and JOB statement, system uses
installation default from the jobclass during the initialization.
If no RD parameter specified at EXEC and JOB Statement has the RD
specified, system uses JOB RD parameter applied to the step.
If RD parameter coded at JOB and EXEC, JOB RD parameter overrides
EXEC RD parameter.
Code EXEC statement RD parameter only if every step requires different RD
parameter values.
Code RD parameter at EXEC statement only if no RD parameter at JOB
statement.

Example 1:

//STEP01 EXEC PGM=SAMPLE,RD=R

RD=R specifies that the operator can perform automatic step restart if the
step fails.

Example 2:

ValueK ValueK used to specify the storage in Kilo bytes.

ValueK values are 1 to 7 digit decimal numbers.

ValueK values are from 1 through 2096128 KB (2047 MB or 2 GB).

ValueK value should also be the multiples of 4.

ValueM ValueM used to specify the storage in Megabytes.

ValueM values are 1 to 4 digit decimal numbers.

ValueM values are from 1 through 2047 MB (2 GB).

ValueM value can also provide in the multiples of 4.

//STEP02 EXEC PGM=SAMPLE,RD=RNC


RD=RNC specifies that the operator can perform automatic step restart
beginning with the step that abnormally terminates.

Example 3:

//STEP03 EXEC PGM=SAMPLE,RD=NR

RD=NR specifies that the operator cannot perform automatic step restart or
automatic checkpoint restart.

Example 4:

//STEP04 EXEC PROC=MTHPROC,RD.STEP02=NR

This EXEC statement calls the cataloged or instream proc MTHPROC.


RD.STEP02=NR specifies that the operator cannot perform automatic step
restart or automatic checkpoint restart for STEP02 in MTHPROC.

JCL EXEC REGION


JCL - EXEC RD
JCL - EXEC PARM

REGION parameter is used to specify the size of the central or virtual storage
required to execute the step.
Region parameter is an optional parameter.
REGION parameter can be coded at JOB level and Step level.
If the REGION parameter coded at both JOB and Step level, JOB card
overrides the Step level parameter.

Syntax:
REGION[.procstepname]= {valueK}
{valueM}
ValueK ValueK used to specify the storage in Kilo bytes.

ValueK values are 1 to 7 digit decimal numbers.

ValueK values are from 1 through 2096128 KB (2047 MB or


2 GB).

ValueK value should also be the multiples of 4.

ValueM ValueM used to specify the storage in Megabytes.

ValueM values are 1 to 4 digit decimal numbers.

ValueM values are from 1 through 2047 MB (2 GB).

ValueM value can also provide in the multiples of 4.

The maximum value can code in the JOB by using either ValueK or ValueM,
is 2GB.
If the REGION parameter coded with 0M, then it allocates the maximum
available storage below 2GB to the JOB. i.e. REGION=0M/0K specifies the
system as REGION=NOLIMIT.

Note:
If the memory provided in the REGION parameter was not sufficient to
execute the job then, the JOB abends with S422/S822.
If the region size specified is not available below 16 megabytes, the job step
abnormally ends with an ABEND822.

Defaults and Overrides:

JOB statement REGION parameter applies to all steps of the job and
overrides any EXEC statement REGION parameters.

Note:
Code EXEC statement REGION parameters when each job step requires a
different region size and avoid coding JOB statement REGION parameter
when coding EXEC statement REGION parameter. Otherwise EXEC
statement REGION parameter will ignored.
Example 1:

//STEP01 EXEC PGM=SAMPLE,ADDRSPC=REAL

This EXEC statement indicates that the step requires 90K of central storage
because of ADDRSPC=REAL.

Example 2:

//STEP02 EXEC PGM=SAMPLE,REGION=90K

This EXEC statement indicates that the step requires 90K of virtual storage.
Because the ADDRSPC parameter is omitted, the system defaults to
ADDRSPC=VIRT.

Example 3:

//STEP03 EXEC PROC=MTHPROC,REGION.STEP01=10K

This EXEC statement calls the cataloged or instream proc MTHPROC.


REGION.STEP01 specifies that the step STEP01 in the MTHPROC requires
10K of virtual storage.

JCL EXEC PARM


JCL - EXEC REGION
JCL - EXEC PGM

The PARM parameter is used to pass the input data from job step to program.
PARM always pass the data from job step to current processing program by
providing the data at the step where the program running.
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 pass maximum 100 characters.
Quotes, parentheses and commas are not included in 100 characters.
Commas in the quotes/parentheses are included as part of 100 characters
which are passed to the program.
The program receives the PARM data by using linkage section.
The program linkage section declaration should have a COMP field along
with field to receive the actual data.
The COMP field in the program contains the length of the data passed from
job step.
To add the PARM data that exceeds the first line, second line should start
from 16th position.
PARM also used to pass runtime input data for the executing program.

Syntax:
PARM[.procstepname]=subparameter
PARM[.procstepname]=(subparameter,subparameter)
PARM[.procstepname]=('subparameter',subparameter)
PARM[.procstepname]='subparameter,subparameter'

subparamet Specifies the information to be passed to the processing


er application program.

Below diagram explains how the JCL PARM data passes to the program
Example 1:

//STEP01 EXEC PGM=SAMPLE,PARM='INPUT,123,MTH=9'

The system passes 'INPUT,123,MTH=9 to the processing program SAMPLE.

Example 2:

// EXEC PROC=MTHPROC,PARM=MTH

The system passes MTH to the first step of the procedure MTHPROC. If
MTHPROC contains more steps and their EXEC statements contain PARM
parameters, the system nullifies those PARM parameters.

Example 3:
//STEP01 EXEC PROC=MTHPROC,PARM.STEP02='INPUT,123,MTH=9'

The system passes INPUT,123,MTH=9 to the procedure step STEP02 in


procedure MTHPROC. If any other procedure steps in MTHPROC contain a
PARM parameter, those PARM parameters remain in effect.

Example 4:

//STEP01 EXEC PGM=SAMPLE,PARM=(MAINFRAMESTECHHELP,'INPUT=77',


// 123)

The system passes MAINFRAMESTECHHELP,'INPUT=77',123 to processing


program SAMPLE.

JCL EXEC PGM


JCL - EXEC PARM
JCL - EXEC PROC

PGM parameter is used to specify the program name the system is to


execute.
PGM parameter also requests the syntax check without executing for JES3.
PGM parameter is used to identify the program which needs to execute by
the system.
EXEC PGM is only used to provide application program name.
The program name specified with PGM must be a member of system library
(PDS or PDSE) or private library (PDS or PDSE) or temporary dataset.

Syntax:

PGM= {program-name }
{*.stepname.ddname }
{*.stepname.procstepname.ddname}
{JCLTEST }
{JSTTEST }

Attribute Description
program-name Specifies the application program
name

The program name is of length 8


characters.

The program name allows


alphanumeric or national characters.

The first character must be alphabetic


or national.

*.stepname.ddname Refers to a DD name that defines the


program to be executed as a member
of PDS or PDSE or a temporary
dataset.

This referring is to execute the


program from the library which is
created by the previous step
(*.stepname.ddname).

Use this form of the parameter when a


previous job step creates a temporary
library to store a program until it is
required.

Refer the below examples to


understand better.
*.stepname.procstepname.d Refers to a DD name that defines the
dname program to be executed as a member
of PDS or PDSE or a temporary
dataset.

This referring is to execute the


program from the library which is
created by the PROC which is
executed in previous step
(*.stepname.procstepname.ddname).

Use this form of the parameter when a


previous job step creates a temporary
library to store a program until it is
required.

Refer the below examples to


understand better.

JCLTEST (JES3 only) Scan for the syntax without executing


JSTTEST (JES3 only) the job.

It also request for the scan without


allocating the devices.

JCLTEST or JSTTEST provides the


same function for a step as provided
by the JOB statement
TYPRUN=SCAN parameter for a job.

Example 1:

// MTHEXMP1 JOB (META007),'PAWAN Y', MSGLEVEL=(1,1)


//STEP1 EXEC PGM=SAMPLE
//STEPLIB DD DSN=MTH.MY.LOADLIB,DISP=SHR

The system searches the private library MTH.MY.LOADLIB for the member
named SAMPLE. System reads the member into storage and executes the
member.

Example 2:
// MTHEXMP2 JOB (META007),'PAWAN Y', CLASS=A
//CREATEL EXEC PGM=IEWL
//SYSLMOD DD DSNAME=&&MTHDS(PROG1),
// UNIT=3390,DISP=(MOD,PASS),
// SPACE=(100,(50,20,1))
//EXECPROG EXEC PGM=*.CREATEL.SYSLMOD

The EXECPROG EXEC statement contains a backward reference to DD


statement SYSLMOD in the CREATEL step. Program PROG1 is a member of
the temporary PDS &&MTHDS. Step EXECPROG executes program
PROG1.

Example 3:

// MTHEXMP3 JOB (META007),'PAWAN Y', CLASS=A


//STEP01 EXEC PROC=MTHPROC
//STEP02 EXEC PGM=*.CREATEL.SYSLMOD
.
.
.
//MTHPROC PROC
//CREATEL EXEC PGM=IEWL
//SYSLMOD DD DSNAME=&&MTHDS(PROG1),
// UNIT=3390,DISP=(MOD,PASS),
// SPACE=(100,(50,20,1))
//PEND

The STEP01 EXEC statement executed MTHPROC which created the


temporary PDS &&MTHDS. The STEP02 contains a backward reference to
DD statement SYSLMOD in the CREATEL step of MTHPROC procedure.
Program PROG1 is a member of the temporary PDS &&MTHDS. Step
STEP02 executes program PROG1.

JCL EXEC PROC


JCL - EXEC PGM
JCL - EXEC TIME

PROC parameter is used to specify the procedure name the system is to


execute.
The procedure can be instream or cataloged procedure.
PROC parameter is used to identify the procedure which needs to execute by
the system.
PROC parameter is optional to execute the procedure.
Procedure can be directly coded with EXEC statement without PROC
keyword.

Syntax:

{PROC=procedure-name}
{Procedure-name }

Procedure- Identifies the procedure to be executed.


name
Procedure-name is alias name or member name for
cataloged procedure.

Procedure-name is name on the PROC statement for


instream procedure.

Procedure-name is of length 1 through 8 characters.

Procedure-name allows alphanumeric or national


characters.

The first character must be alphabetic or national.

Note:
PROC= parameter can be omitted to execute the PROC.

Example 1:

//STEP01 EXEC PROC=MTHPROC

The above statement calls the cataloged or in-stream procedure named


MTHPROC.

Example 2:

//STEP01 EXEC MTHPROC


The above statement calls the cataloged or in-stream procedure named
MTHPROC.

JCL EXEC TIME


JCL - EXEC PROC
JCL - DD Statement

TIME parameter specifies the maximum amount of time that step may use the
processor.
In other words, TIME specifies the maximum CPU usage time allowed for the
step to execute.
TIME parameter is optional parameter.
TIME parameter can be coded at the JOB level and step level too.
System will automatically cancel the JOB execution, if the execution time
reaches to the TIME specified.
In other words, TIME parameter will notify the maximum CPU utilization time
to OS and once the specified time utilized by the job, OS will automatically
cancel the job.
If TIME parameter not specified, then the default value is 1440 min/24 Hours/
1 day.
Default time in TIME parameter can vary system to system based on
installation/setup.
If the TIME parameter value is less than the default value from the system
installation, TIME parameter can be used on JOB statement.
If the TIME parameter value is greater than the default value from the system
installation, TIME parameter can’t be used on JOB statement.
If the TIME parameter value is greater than the default value from the system
installation, TIME parameter can be used on EXEC statement.

Syntax:

TIME[.procstepname]= {([minutes][,seconds])}
{1440 }
{NOLIMIT }
{MAXIMUM }
{0 }

NOLIMIT or 1440:

NOLIMIT or 1440 Minutes values are almost functionally same.


Both specify that the step can use the processor for unlimited time.
In other words, both assign unlimited time for the step execution.
1440 means 24 hours.
If NOLIMIT or 1440 Minutes specified at JOB card level, all TIME parameters
specified at step level will be overwritten.
If NOLIMIT or 1440 coded, the system will allow waiting the particular JOB
step more than the default time specified during the system installation.

MAXIMUM:

Specifies the step can use the processor for the maximum amount of time.
If MAXIMUM coded in TIME parameter, step can use 248.55 days (357912
minutes) processor time.

Minutes:
Specifies the step can use the processor for the maximum amount of
minutes.
Minutes must be a number from 0 through 357912 (248.55 days).
Any number between 0 through 357912 (248.55 days) should be coded with
TIME parameter, the system allows that many minutes to use the processor.
If ZERO specified in TIME parameter, it may produce unpredictable results.

Seconds:
Specify the step can use the processor for that many seconds in addition to
the minutes specified.
Seconds always specifies along with the Minutes.
Seconds must be a value in between 0 to 59 seconds.

Note:
If the TIME provided in step is not sufficient to execute, then JOB will fail with
the abend code S322.

Defaults:

If TIME parameter not specified on the JOB statement, the time limit for each
job step is:

• EXEC statement TIME parameter value


• The default time limit, if not specified on EXEC statement.

Overrides:
If the JOB statement TIME parameter coded as TIME=NOLIMIT or
TIME=1440, the system nullifies any TIME parameters on EXEC statements
as well as the default TIME values.
All steps within the job will have unlimited processor time.

If the JOB statement TIME parameter coded other than TIME=NOLIMIT or


TIME=1440, the system sets the time limit for each step as below.

1. If the EXEC statement TIME parameter coded, system will pick smaller
one among EXEC statement TIME parameter value and the time
remaining after execution of previous steps from JOB statement TIME
parameter value.
2.
3. If the EXEC statement TIME parameter not coded, system will pick
smaller one among default time limit value and the time remaining after
execution of previous steps from JOB statement TIME parameter value.

Example 1:

//STEP01 EXEC PGM=SAMPLE,TIME=1140

In the above example, the TIME statement can specify that the step can use
the processor for unlimited time.

Example 2:

//STEP01 EXEC PGM=SAMPLE,TIME=(9,30)

In the above example, the TIME statement can specify that the step can use
the processor for 9 minutes and 30 seconds.

Example 3:

//STEP01 EXEC PGM=SAMPLE,TIME=(,45)

In the above example, the TIME statement can specify that the step can use
the processor for 45 seconds.

Example 4:

//STEP01 EXEC PGM=SAMPLE,TIME=MAXIMUM


In the above example, the TIME statement can specify that the step can use
the processor for 248.55 days (357912 minutes).

Example 5:

//MTHEXMP1 JOB (META007),'PAWAN Y', TIME=6


//STEP01 EXEC PROG=A,TIME=2
//STEP02 EXEC PROG=B,TIME=6

In the above example, the STEP01 should complete in 2 minutes as the


minimum of 6 and 2 is 2.
STEP02 should complete in 4 minutes max as the minimum of 6 and 4 (JOB
TIME value – STEP01 TIME value) is 4.
If any of the above step executing beyond the time calculated, then the job
will terminates abnormally.

Example 6:

//STEP01 EXEC PROC=MTHPROC,TIME.STEP02=(9,30)

This EXEC statement calls the cataloged or instream proc MTHPROC.


TIME.STEP02 specifies that the step STEP02 in the MTHPROC can use the
processor for 9 minutes and 30 seconds.

Example 7:

//MTHEXMP1 JOB (META007),'PAWAN Y'


//STEP01 EXEC PROG=A,TIME=20
//STEP02 EXEC PROG=B,TIME=0

In the above example, the STEP01 can use 20 minutes of processor time. Let
us assume STEP01 completes in 10 minutes.
STEP02 can use the remaining 10 minutes of processor time as STEP02 do
not have any minutes.

JCL DD Statement
JCL - EXEC TIME
JCL – DD BLKSIZE

Before proceding with EXEC statement, Refer the JCL Coding sheet topic.
DD stands for Data Definition.
DD specifies the data set to be used in the JOB step and responsible to
provide the specification about how to use the data set.
DD statement is left justified.
DD Statement has the dataset and its physical characteristics details.
Each EXEC statement may have its corresponding DD statements that are
used in application program or utility.
The DD name used in the program must be same as the DDname in the DD
statement.
DD statement in the job contains the actual/full name of data set.
DD names may not be unique among the multiple steps and should be
unique in the specific step.
The maximum number of DD statements per job step is 3273.
The 3273 is based on single DD statements allowed for a TIOT (task input
output table) control block size of 64K.
The DD statements number can vary from system to system based on the
TIOT control block size.

Syntax:

// [ddname ] DD [positional-parameter][,keyword-
parameter]...[comments]
[proc-stepname.ddname]

// [ddname ] DD
[proc-stepname.ddname]

DD statement can be divided into the below parts.

1. DD name
2. Operation(DD)
3. Parameters
4. Comment

Note:
Do not code comment if the parameter field is blank.

DD name:
The DD name used in the program must be same as the DDname in the DD
statement.
DD must be unique within the job step.
DD name can be ignored/omitted from the second dataset, if all the datasets
are used for concatenation.
Use proc-stepname.ddname to override or add the DD name to the proc-
stepname step.

Rules:

DD always begins in the column 3 and column 1 & 2 contains ‘//’.


DD name is 1 through 8 characters.
DD name is a combination of alphanumeric and national characters (@,# and
$).
DD name first character should be alphabetic or national character.
DD name must be followed by one blank before DD.

Operation:
Operation field describes about the type of operand.
Operation field consists of DD characters.
Operation field can start in any column.
Operation field is mandatory with every DD name.
Operation field must be followed by one blank.

Parameters:
DD statement has two types of parameters.

• Positional parameters
• Keyword parameters

Positional parameter (positional-parm):

Positional parameters are optional.


The DD statement may contain one or more positional parameters.
Positional parameter must start after DD statement and before keyword
parameters.
Positional parameters can start in any column.
Positional parameters are optional even though operation field is specified.
DD statement has two positional parameters.
Positional Purpose
Parameter

*/DATA Begins a instream dataset

DUMMY Specifies no space allocation and no disposition


processing.

DYNAM DYNAM parameter to provide the compatibility with


previous system.

Keyword parameters (keyword-parameter):

DD statement can be coded with keyword parameters.


The keyword parameters can code in any order.
The DD statement can contain one or more keyword parameters with it.
Below keyword parameters are used with DD statement.

Keyword Parameter Purpose

BLKSIZE Specifies the maximum length of block

DCB Data control block

DDname Postpone defining dataset until later in same


step

DEST Sends the sysout dataset to specified


destination

DISP Specifies the status of the dataset

DSNAME Specifies the name of the dataset

DSNTYPE Specifies the type of the dataset


EXPDT Specifies the expiration date for the dataset

KEYLEN Specifies the length of the key in the dataset

LABEL Specifies the information about the dataset


label

LIKE Specifies the attributes of the new dataset

LRECL Specifies the length of the records

OUTLIM Specifies the logical records limit in the dataset

OUTPUT Associates with one or more output datasets

RECFM Specifies the record format

RECORG Specifies the record organization

RETPD Specifies the retention period of the dataset

SPACE Requests the space for the new dataset

SYSOUT Defines the dataset as a sysout dataset

UNIT Request the allocation to a specific device

VOLUME Specifies the volume on which the dataset


resides

Comment:
Comment used to make a note of current statement.
Comment field follows parameter field.
Comment field should be preceded with a blank after the parameter field.

Example 1:

//STEP01 EXEC PGM=SAMPLE


//INPUT1 DD DSNAME=MTH.INPUT.FILE,DISP=SHR
//OUTPUT1 DD DSNAME=MTH.INPUT.FILE,DISP=(NEW,CATLOG,DELETE)

In this example, INPUT1 is the input file for the program SAMPLE and
OUTPUT1 is the new output file going to create.

Example 2:

//STEP01 EXEC PGM=SAMPLE


//INPUT1 DD DSNAME=MTH.INPUT.FILE1,DISP=SHR
// DD DSNAME=MTH.INPUT.FILE2,DISP=SHR

In the above example, the ddname is missing from the second DD statement.
Because the datasets specified to concatenate.

Example 3:

//STEP01 EXEC PROC=MTHPROC


//STEP02.INPUT DD DSNAME=MTH.INPUT.FILE1,DISP=SHR

In this example, if procedure step STEP01 contains a DD statement named


INPUT, then the statement overrides parameters on DD statement STEP02.
If the step STEP02 does not contain DD statement INPUT, the system adds
this statement to procedure step STEP02 of the job step.

JCL DD BLKSIZE
JCL DD Statement
JCL – DD DCB

BLKSIZE parameter used to specify the maximum size of the block.


BLKSIZE is an optional parameter.

Syntax:

BLKSIZE= {value}
{valueK}
{valueM}
{valueG}

Value Specifies the maximum length in bytes of block.

The value specified with BLKSIZE depending the system.

Maximum value that can code in bytes is 2,147,483,648.

For dummy data sets, the value is 2,147,483,648.

ValueK Specifies the maximum length in kilobytes of block.

Maximum value that can code in bytes is 2097152K.

For dummy data sets, the value is 2097152K.

ValueM Specifies the maximum length in Megabytes of block.

Maximum value that can code in bytes is 2048M.

For dummy data sets, the value is 2048M.

ValueG Specifies the maximum length in Gigabytes of block.

Maximum value that can code in bytes is 2G.

For dummy data sets, the value is 2G.

Defaults and Overrides:


If the BLKSIZE not coded, system will determine the optimum block size.
If a none zero value specified in BLKSIZE parameter in DCB or DD
statement, it will override the block size specified in the label.

Example 1:

//NEWFILE DD DSNAME=MTH.INPUT.FILE,DISP=(NEW,KEEP),UNIT=3590,
// RECFM=FB,LRECL=900,BLKSIZE=9500
In the above example, the block size defined as 9500 bytes.

Example 2:

//NEWFILE DD DSNAME=MTH.INPUT.FILE,DISP=(NEW,KEEP),UNIT=3590,
// RECFM=FB,LRECL=900,BLKSIZE=100K

In the above example, the block size defined as 100K. i.e. 100 * 1024 =
102400 bytes.

JCL DD DCB
JCL – DD BLKSIZE
JCL – DD DEST

DCB parameter used to complete the dataset information.


DCB parameter constructed by file definition statements or language defined
defaults.
DCB parameter used while creating the dataset through JCL.
DCB mainly used to specify the attributes of the dataset. i.e. record length,
record format, organization type etc.,
DCB parameter is mandatory for creating new file/dataset from JCL.
DCB is an optional parameter.

Syntax:

[ DCB=(subparameter[,subparameter]...) ]

[ DCB= ( {dsname }[,subparameter]...) ]


[ ( {*.ddname } ) ]
[ ( {*.stepname.ddname } ) ]
[ ( {*.stepname.procstepname.ddname} ) ]

The parenthesis can be ignored when specifying one keyword subparameter


or only dataset name or only backward reference.
If multiple subparameter specifying, those should be separated by comma
and enclosed by parenthesis.
The system gets the DCB information in the below sources in override order:

• The processing program file definition statements


• DD statement DCB parameter
• Dataset label

Below are the lists of subparameters of DCB.

• BFALN
• BFTEK
• BLKSIZE
• BUFIN
• BUFL
• BUFMAX
• BUFNO
• BUFOFF
• BUFOUT
• BUFSIZE
• CPRI
• CYLOFL
• DEN
• DIAGNS
• DSORG
• EROPT
• FUNC
• GNCP
• INTVL
• IPLTXID
• KEYLEN
• LIMCT
• LRECL
• MODE
• NCP
• NTM
• OPTCD
• PCI
• PRTSP
• RECFM
• RESERVE
• RKP
• STACK
• THRESH
• TRTCH

Example 1:

//DD1 DD DSNAME=MTH.DATA.FILE,DISP=(NEW,KEEP),
// DCB=(RECFM=FB,LRECL=425,BLKSIZE=18000),
// SPACE=(50,10)

DD statement DD1 defines a new data set MTH.DATA.FILE. The DCB


parameter contains the information necessary to complete the data control
block.

Example 2:

//DD1 DD DSNAME=MTH.DATA.FILE1,DISP=SHR
//DD2 DD DSNAME=MTH.DATA.FILE2,DISP=(NEW,KEEP),
// DCB=*.DD1,
// SPACE=(50,10)

DD statement DD2 defines a new data set MTH.DATA.FILE2. The DCB


parameter requests to copy the DCB parameters from MTH.DATA.FILE1 to
MTH.DATA.FILE2 and create it.

Example 3:

//DD2 DD DSNAME=MTH.DATA.FILE2,DISP=(NEW,KEEP),
// DCB=*.STEP01.MTHPROC.DD1,
// SPACE=(50,10)

DD statement DD2 defines a new data set MTH.DATA.FILE2. The DCB


parameter requests to copy the DCB parameters from DD1 from STEP01 of
MTHPROC to MTH.DATA.FILE2 and create it.

JCL DD DEST
JCL – DD DCB
JCL – DD DISP

DEST parameter used to specify the destination for the sysout dataset.
The DEST parameter can send the sysout dataset to the various destinations
like remote or local terminal, node, remote workstation, local device, group of
devices and node and userid.
Code DEST parameter with SYSOUT always, otherwise it ignores it.

Syntax:

DEST=destination
The destination subparameter for JES3 is one of the following:

• ANYLOCAL
• device-name
• device-number
• group-name
• nodename
• (nodename,userid)
• (nodename,devicename)

ANYLOCAL Specifies any local device that is attached to


the global processor.

device-name Identifies a local device by a symbolic name.

The name defined by the installation.

device-name is 1 through 8 characters.

Device-name accepts alphanumeric or national


characters.

device-number Identifies a specific device by a 3-digit or 4-digit


hexadecimal number.

4-digit number proceeded with a slash (/).

3-digit number can be specified with or without


a slash.
group-name Identifies a group of local devices, an individual
remote station, or a group of remote stations by
a symbolic name.

The name defined by the installation.

Group-name is 1 through 8 characters.

Group name allows alphanumeric or national


($, #, @) characters.

nodename Identifies a node by a symbolic name.

The name defined by the installation.

nodename is 1 through 8 characters.

The name allows alphanumeric or national


characters.

(nodename,userid) Identifies a nodename and userid at that


nodename.

The nodename is a symbolic name defined by


the installation.

The nodename is 1 through 8 characters.

The nodename allows alphanumeric or national


characters.

The userid must be defined at the nodename.

userid is 1 through 7 characters for TSO/E.

userid is 1 through 8 characters for VM.

Userid allows alphanumeric or national ($, #,


@) characters.
(nodename,devicen Identifies a node by a symbolic name.
ame)
devicename identifies a device by a symbolic
name.

The names are defined by the installation.

nodename and devicename are each 1 through


8 characters.

nodename and devicename allows


alphanumeric or national characters.

devicename is 1 through 8 characters.

Devicename allows alphanumeric or national


characters.

Defaults and overrides:


If the DEST parameter not specified, JES directs the sysout dataset to the
default destination from which the job submitted.
If the Destination specified with DEST parameter is invalid, job will fail.
The DEST parameter on the sysout statement overrides the JCL OUTPUT
DEST parameter.

Example 1:

//STEP01 EXEC PROG=SAMPLE


//DD1 DD DSNAME=MTH.DATA.FILE,DISP=(NEW,KEEP),
// DCB=(RECFM=FB,LRECL=425,BLKSIZE=18000),
// SPACE=(50,10)
//OUTPUT DD SYSOUT=*

System sends the sysout data set defined by DD statement OUTPUT to the
work station that submitted the job.

Example 2:

//STEP01 EXEC PROG=SAMPLE


//DD1 DD DSNAME=MTH.DATA.FILE,DISP=(NEW,KEEP),
// DCB=(RECFM=FB,LRECL=425,BLKSIZE=18000),
// SPACE=(50,10)
//OUTPUT DD SYSOUT=*,DEST=NODE12

System sends the sysout data set defined by DD statement OUTPUT to the
node NODE12.

Example 3:

//STEP01 EXEC PROG=SAMPLE


//DD1 DD DSNAME=MTH.DATA.FILE,DISP=(NEW,KEEP),
// DCB=(RECFM=FB,LRECL=425,BLKSIZE=18000),
// SPACE=(50,10)
//OUTPUT DD SYSOUT=*,DEST=(NODE12,’MTHUSER’)

System sends the sysout data set defined by DD statement OUTPUT to VM


userid MTHUSER at the node NODE12.

JCL DD DISP
JCL – DD DEST
JCL – DD DSNAME

DISP parameter describes the status of the dataset.


DISP parameter also describes the system what to do with the dataset after
the job step termination.
DISP stands for DISPOSITION.
DISP is an optional parameter.
DISP parameter can be specified for normal termination and one for
abnormal termination.
Dataset disposition controlled solely by DISP parameter.
It is used to describe the status of the dataset that is coded with the DD
statement.
If the system obtains unit and volume information for an OLD, MOD, or SHR
status, the data set is treated as if it exists or not physically on the device.

One of two methods can be used to request exclusive control:

• DISP=NEW, DISP=MOD, or DISP=OLD on a JCL request.


• DISP=NEW, DISP=MOD, or DISP=OLD on a dynamic allocation
request.
Syntax:

{DISP=[status]
}
{DISP=([status][,normal-termination-disp][,abnormal-termination-
disp])}

DISP= ( [NEW] [,DELETE ] [,DELETE ] )


[OLD] [,KEEP ] [,KEEP ]
[SHR] [,PASS ] [,CATLG ]
[MOD] [,CATLG ] [,UNCATLG]
[, ] [,UNCATLG]
[, ]

If the any parameter ignored, then comma need to be coded to indicate the
absence of the parameter.

STATUS:
STATUS parameter is used to specify the condition status of the dataset
provided.
The Status parameter values of the dispositional parameters are given below.

Status Description

NEW Specifies the new dataset is to be created in the specified


step.

SHR Specifies the data set exists before this step.

Other jobs can share the dataset and use the dataset at the
same time.

This sub parameter can also be coded as SHARE.

OLD Specifies that the data set exists before this step.

The step specified requires exclusive (unshared) use of the


data set.
MOD The data set exists before this step.

The records are to be added to the end of dataset.

The dataset must be sequential.

A new data set is to be created if dataset not existed.

If status parameter is ignored, the default value is NEW.

Normal-termination-disp:
Normal-termination-disp describes the system that what action needs to be
performed on dataset when JOB step terminates normally.
Normal-termination-disp have the below list of values

1. KEEP
2. DELETE
3. PASS
4. CATLG
5. UNCATLG

KEEP:

Inform to system that the dataset to be kept on the volume after step
terminates successfully.
Keep will not alter any memory allocations done earlier for the dataset.

DELETE:

Inform to system that the dataset is no longer after step terminates


successfully.
DELETE means making the memory available for other datasets usage.
The system physically erases the dataset if the erase option is in effect.
If the erase option is not in effect, the data will remain in DASD until the other
dataset overrides.
If the EXPDT, RETPD set for the dataset, the datasets will be kept even
though DISP coded with DELETE as Normal-termination-disp.
If new dataset is specified with DISP=(NEW,DELETE,), it will delete at the
end of the step.
PASS:

Inform to system that the catalog entry needs to be placed after step
terminates successfully.
Dataset is kept for CATLG entry if the step completed successfully.

CATLG:

Inform to system that the catalog entry needs to be placed after step
terminates successfully.
Dataset is kept for CATLG entry if the step completed successfully.

UNCATLG:

Inform to system that uncatalog the dataset after step terminates


successfully.
UNCATLG will do two tasks
1. Removes entry in system or user catalog directory for dataset.
2. All unneeded indexes will be deleted.

UNCATLG will not remove data from the dataset which was uncataloged.

Abnormal-termination-disp:
Abnormal-termination-disp describes the system that what action needs to be
performed on dataset when JOB step terminates abnormally.
Abnormal-termination-disp have the below list of values.

1. KEEP
2. DELETE
3. CATLG
4. UNCATLG

KEEP:

Inform to system that the dataset to be kept on the volume after step
terminates abnormally.
Keep will not alter any memory allocations done earlier for the dataset.

DELETE:
Inform to system that the dataset is no longer after step terminates
abnormally.
DELETE means making the memory available for other datasets usage.
The system physically erases the dataset if the erase option is in effect.
If the erase option is not in effect, the data will remain in DASD until the other
dataset overrides.
If the EXPDT, RETPD set for the dataset, the datasets will be kept even
though DISP coded with DELETE as abnormal-termination-disp.
If new dataset is specified with DISP=(NEW,,DELETE), it will delete at the
end of the step.

CATLG:

Inform to system that the catalog entry needs to be placed after step
terminates abnormally.
Dataset is kept for CATLG entry if the step completed abnormally.

UNCATLG:

Inform to system that uncatalog the dataset after step terminates abnormally.
UNCATLG will do two tasks
1. Removes entry in system or user catalog directory for dataset.
2. All unneeded indexes will be deleted.

UNCATLG will not remove data from the dataset which was uncataloged.

Defaults and overrides:


1. If the status subparameter ignored, the default is NEW.
2. If the normal termination disposition subparameter ignored, the default
is DELETE for a NEW data set or KEEP for an existing data set.
3. If the abnormal termination disposition subparameter ignored, the
default is the disposition specified or implied by the second
subparameter.
4. If the abnormal termination disposition subparameter ignored and the
second subparameter specified as PASS, the default abnormal
termination disposition is DELETE for a NEW data set or KEEP for an
existing data set.
5. If the DISP parameter ignored, the default is a NEW data set with a
disposition of DELETE for both normal and abnormal termination
disposition. i.e. DISP=(NEW, DELETE, DELETE).
Note:
The DISP parameter can’t be ignored for a data set that is created and
deleted during a step.

Example 1:

//STEP01 EXEC PROG=SAMPLE


//DD1 DD DSNAME=MTH.DATA.FILE,DISP=(NEW,CATLOG,DELETE),
// DCB=(RECFM=FB,LRECL=425,BLKSIZE=18000),
// SPACE=(50,10)

The statements requests that the system CATLOG the new data set if the
step terminates normally and DELETE the dataset if the step terminates
abnormally.

Example 2:

//STEP01 EXEC PROG=SAMPLE


//DD1 DD DSNAME=MTH.DATA.FILE,
// DCB=(RECFM=FB,LRECL=425,BLKSIZE=18000),
// SPACE=(50,10)

The DISP parameter ignored in the above statement and


DISP=(NEW,DELETE, DELETE) applies to the step. The statements requests
that the system to DELETE the new data set even though the step terminates
normally or abnormally.

Example 3:

//STEP01 EXEC PROG=SAMPLE


//DD1 DD DSNAME=MTH.DATA.FILE,DISP=(OLD,KEEP,),
// DCB=(RECFM=FB,LRECL=425,BLKSIZE=18000),
// SPACE=(50,10)

The statement requests that the system KEEP the old data set if the step
terminates normally.

Example 4:

//STEP01 EXEC PROG=SAMPLE


//DD1 DD DSNAME=MTH.DATA.FILE,DISP=(NEW,PASS,),
// DCB=(RECFM=FB,LRECL=425,BLKSIZE=18000),
// SPACE=(50,10)
The statements requests that the system PASS the new data set to the next
steps if the step terminates normally and DELETE the dataset if the step
terminates abnormally.

JCL DD DSNAME
JCL – DD DISP
JCL – DD DSNTYPE

DSNAME specifies the name of the dataset.


DSNAME can require the existing dataset or new dataset.
For the new dataset, the specified name is assigned to dataset.
For the existing dataset, the specified name used to locate the dataset.
DSNAME required some additional keyword parameters like DISP, SPACE,
DCB etc,.
The DSNAME is referred with DSNAME or DSN.
Blanks can be included in the dataset name if the name enclosed with
apostrophes.
If the dataset name started with space, then the system treats it as a
temporary dataset and ignores the remaining name specified.
System ignores the blank characters at the end of the dataset name.
System does not check the dataset names enclosed with apostrophes for
valid length or valid characters.

Valid special characters:

• .(Period)
• &&(double ampersands)
• ()(Parentheses)
• +(plus)
• -(minus)
• *(asterisk)

Syntax:

{DSNAME} =dsname
{DSN }

name for permanent data set:

dsname
dsname(member)
dsname(generation)

name for temporary data set:

&&dsname
&&dsname(member)

name for in-stream or sysout data set:

&&dsname

name copied from earlier DD statement:

*.ddname
*.stepname.ddname
*.stepname.procstepname.ddname

name for dummy data set:

NULLFILE

dsname dsname can be a qualified name or


unqualified name.

Unqualified name Name can be 1 through 8 characters.

Name allows alphanumeric or national


($, #, @) characters, a hyphen, or a
character X'C0'.

The first character must be alphabetic


or national ($, #, @).
Qualified name Multiple unqualified names combined
through period.

Each qualifier should be like


unqualified name.

The name must contain a period after


every 8 character.

The maximum length of the dataset


name is 44 characters including
period.

For generation datasets, the name is


35 characters including period.

&&dsname Specifies the name of a temporary


data set.

&&dsname(member) Specifies the name of a PDS/PDSE


and a member within that data set.

member Member name is 1 through 8


characters.

Member name allows alphanumeric or


national characters, or a character
X'C0'.

The first character must be alphabetic


or national.

*.ddname Specifies the system to copy the data


set name from earlier DD statement
ddname.
*.stepname.ddname Specifies the system to copy the data
set name from DD statement(ddname)
in an earlier step(stepname) in the
same job.

*.stepname.procstepname.d Specifies the system to copy the data


dname set name from a DD statement in a
cataloged or in-stream procedure.

NULLFILE Specifies a dummy data set.

NULLFILE has the same outcome as


coding the DD DUMMY parameter.

Example 1:

//DD01 DD DSNAME=MTHDATA,DISP=(NEW,KEEP),
// UNIT=3390

DD statement DD01 defines a new data set and names it MTHDATA.

Example 2:

//DD01 DD DSNAME=MTH.DATA,DISP=(NEW,KEEP),DATACLAS=DCLAS7,
// MGMTCLAS=MCLAS7,STORCLAS=SCLAS7

DD statement DD01 defines a new SMS-managed data set and names it


MTH.DATA.

Example 3:

//DDIN DD DATA,DSNAME=&&MTHIN
.
data
.
/*

DD statement DDIN defines MTHIN as the last qualifier of the system-


generated data set name for the in-stream data set.

Example 4:
//DDOUT DD DSNAME=&&MTHOUT,SYSOUT=M

DD statement DDOUT defines MTHOUT as the last qualifier of the system-


generated data set name for the sysout data set.

Example 5:

//DD01 DD DSNAME=&&MTHWORK,UNIT=3390

DD statement DD01 defines a temporary data set.

JCL DD DSNTYPE
JCL – DD DSNAME
JCL – DD EXPDT

DSNTYPE parameter used to specify the type of the dataset to be created.


DSNTYPE parameter can specify the below dataset types.

• partitioned data set (PDS)


• partitioned data set extended (PDSE)
• hierarchical file system (HFS) data set
• A first-in first-out (FIFO) special file
• basic format data set
• large format data set
• extended format data set

DSNTYPE is optional parameter.


DSNTYPE parameter always specifies with DD statement during the new
dataset creation.

Syntax:

DSNTYPE= {LIBRARY}
{(LIBRARY,1)}
{(LIBRARY,2)}
{HFS }
{PDS }
{PIPE }
{EXTREQ }
{EXTPREF}
{LARGE }
{BASIC }

LIBRARY Specifies a partitioned dataset extended


(PDSE).

A PDSE may contain data or program object


members.

(LIBRARY,1) Specifies a version 1 partitioned dataset


extended (PDSE).

A PDSE version 1 may contain data or program


object members.

(LIBRARY,2) Specifies a version 2 partitioned dataset


extended (PDSE).

A PDSE version 2 may contain data or program


object members.

HFS Specifies an HFS dataset.

PDS Specifies a partitioned data set (PDS).

A PDS may contain data or program object


members.

PIPE Specifies a FIFO special file.

EXTREQ | (EXTREQ, Specifies for the data set to be extended


1) | (EXTREQ,2) format.

(EXTREQ,1) specifies a version 1 extended


format data set.

(EXTREQ,2) specifies a version 2 extended


format data set.
EXTPREF | Specifies for the data set to be extended
(EXTPREF,1) | format.
(EXTPREF,2)
If extended format is not possible, the system
selects basic format.

(EXTPREF,1) specifies a version 1 extended


format data set.

(EXTREQ,2) specifies a version 2 extended


format data set.

LARGE The system will select large format if the data


set is sequential (DSORG=PS or PSU).

DSORG is omitted from all sources and the


data set is not VSAM.

BASIC The system will select basic format if the data


set is sequential (DSORG=PS or PSU).

DSORG is omitted from all sources and the


data set is not VSAM.

Example 1:

//DD01 DD DSNAME=MTH.DATA(FILE),DISP=(NEW,KEEP)

The DD01 DD statement defines member FILE in the new PDSE named
MTH.DATA.

Example 2:

//DD01 DD DSNAME=MTH.DATA(FILE2),DISP=(NEW,KEEP),
// DATACLAS=DCLAS07,DSNTYPE=LIBRARY

The DD01 DD statement defines member FILE2 in the new PDSE named
MTH.DATA.

Example 3:
//DD01 DD DSNAME=MTH.DATA(FILE3),DISP=SHR,
// DATACLAS=DCLAS07,DSNTYPE=LIBRARY

DD01 DD statement adds a new member named FILE3 to the existing PDSE
named MTH.DATA. DSNTYPE=LIBRARY overrides the DSNTYPE attribute in
data class DCLAS07 but uses other data set attributes in DCLAS07.

Example 4:

//DD01 DD DSNAME=MTH.DATA(FILE4),DISP=(NEW,KEEP),
// DATACLAS=DCLAS07,DSNTYPE=(LIBRARY,2)

The DD01 DD statement defines member FILE4 in the new PDSE named
MTH.DATA. DSNTYPE=(LIBRARY,2) overrides the DSNTYPE attribute in
data class DCLAS07 but uses other data set attributes in DCLAS07.

Example 5:

//DD01 DD DSNAME=MTH.DATA,DATACLAS=DCLAS07,
// DISP=(NEW,KEEP),DSNTYPE=HFS,SPACE=(CYL,(100,100,1))

The DD01 DD statement creates an HFS dataset to contain an HFS file


system. The DCLAS07 in DATACLAS specifies allocation characteristics.

JCL DD EXPDT
JCL – DD DSNAME
JCL – DD KEYLEN

EXPDT used to specify the expiration date for a new data set.
On or after the date specified, the dataset get deleted or overwritten by
another one.
EXPDT does same as RETPD parameter.
Code EXPDT parameter when it actually needed.
EXPDT is an optional parameter.

Note:
Do not specify the expiration date for temporary dataset.

Syntax:
EXPDT= {yyddd }
{yyyy/ddd}

EXPDT=yyddd Specifies an expiration date for the data set.

This form of expiration supports two-digit year number


yy and three digit date ddd.

Two digit year yy from 00 through 99.

Three digit days ddd from 001 through 365 for normal
years and 001 through 366 for leap years.

Note:
Expiration dates of 99365 and 99366 are considered
“never-scratch” dates. Data sets with these expiration
dates are not deleted or written over and simply exist
for ever.

EXPDT=yyyy/ Specifies an expiration date for the data set.


ddd
This form of the expiration date specifies a four-digit
year number yyyy and three digit date ddd.

Four digit year yyyy from 1900 through 2155.

three-digit day number ddd from 001 through 365 for


a non-leap year date and from 001 through 366 for a
leap year date.

Note:
Expiration dates of 1999/365 and 1999/366 are
considered “never-scratch” dates. Data sets with
these expiration dates are not deleted or written over
and simply exist for ever.
For expiration dates of January 1, 2000 and later, you
MUST use the form EXPDT=yyyy/ddd.

Example 1:
//DD01 DD DSNAME=MTH.DATA,DISP=(NEW,KEEP),EXPDT=2019/027,
// UNIT=SYSDA,SPACE=(TRK,(1,1))

The data set is not eligible for being deleted or written over until January 27,
2019.

Example 2:

//DD01 DD DSNAME=MTH.DATA,DATACLAS=DCLAS07,DISP=(NEW,KEEP),
// EXPDT=2018/027

The expiration date of January 27, 2018 overrides the expiration date defined
in the data class for the data set.

JCL DD KEYLEN
JCL – DD EXPDT
JCL – DD LIKE

KEYLEN parameter used to specify the length of the key used in new
dataset.
KEYLEN parameter is an optional parameter.
If KEYLEN is not specified, the dataset must not require any keys.
KEYLEN applies to data sets with the BDAM, BPAM, BSAM, EXCP and
QISAM access methods and to VSAM data sets with SMS.
Syntax:

KEYLEN=bytes

bytes Specifies the key length in bytes.

Key length is 0 to 255 for non-VSAM data sets.

The key length must be less than or equal to the record length.

Key length is 1 to 255 for VSAM key-sequenced


(RECORG=KS) data sets.
Note:
Use only 0 for a member of a partitioned data set extended (PDSE).
Example 1:

//DD01 DD DSNAME=MTH.DATA,DISP=(NEW,KEEP),UNIT=3390,
// SPACE=(CYL,(12,2)),KEYLEN=8

DD statement DD01 defines a new data set named MTH.DATA with the key
length 8 bytes.

Example 2:

//DD01 DD DSNAME=MTH.VDATA,DATACLAS=VSAM1,DISP=(NEW,KEEP),
// KEYLEN=6

In the example, where the data class VSAM1 defines a key-sequenced


VSAM data set, the key length of 6 overrides the key length defined in the
data class.

JCL DD LIKE
JCL – DD KEYLEN
JCL – DD LRECL

LIKE parameter used to specify the allocation of new dataset attributes by


copying from a model dataset.
The model dataset should be cataloged dataset and should be existed in
direct access volume.
The below list of attributes can be copied from model dataset to new dataset.

• Data set organization (RECORG) or(RECFM)


• Record length (LRECL)
• Key length (KEYLEN)
• Key offset (KEYOFF)
• Type (DSNTYPE)
• Space allocation (AVGREC and SPACE)

LIKE parameter can be used with SMS only.


LIKE is an optional parameter.
If SMS is not installed or is not active, the system syntax checks and ignores
the LIKE parameter.
The retention period (RETPD) or expiration date (EXPDT) is not copied to the
new data set.

Note:
temporary data set (&&dsname) attributes can’t be copied by using LIKE
parameter.
Syntax:

LIKE=data-set-name

data-set-name Specifies the data set name (dsname) of the model


data set.

Defaults and overrides:


Any attributes attained using the LIKE parameter override the corresponding
attributes in the DATACLAS parameter.
Any attributes specify on the same DD statement override the corresponding
attributes obtained from the model data set.

Example 1:

//DD01 DD DSNAME=MTH.DATA,LIKE=MTH.DATA1,DISP=(NEW,KEEP)

In the above example, the data set attributes used for MTH.DATA are
obtained from the cataloged model data set MTH.DATA1.

Example 2:

//DD01 DD DSNAME=MTH.DATA,LIKE=MTH.DATA1,DISP=(NEW,KEEP),
// LRECL=900

In the above example, the data set attributes used for MTH.DATA are
obtained from the cataloged model data set MTH.DATA1 and the logical
record length of 900 overrides the logical record length obtained from the
model data set.

JCL DD LRECL
JCL – DD LIKE
JCL – DD OUTLIM
LRECL parameter is used to specify the records length in new datasets.
LRECL is an optional parameter.
LRECL applies to data sets with the BPAM, BSAM, EXCP, QISAM, and
QSAM access methods.
LRECL applies to VSAM with SMS.

Syntax:

LRECL=(bytes)

bytes Specifies the length in bytes for fixed length records.

Specifies the length in bytes for fixed length records.

Specifies the maximum length in bytes for variable-length


records.

The value is 1 to 32,760 for non-VSAM data sets.

The value is 1 to 32,761 for VSAM key-sequenced (KS), entry-


sequenced (ES), or relative record (RR) data sets.

For VSAM key-sequenced (KS) data sets, a record length must


be specified.

The record length must be greater than the key length.

Note:
For RECFM is F or U, the length must not exceed DCB BLKSIZE.
For RECFM=D or V, the length must be a minimum of 5 and a maximum of
BLKSIZE minus 4. For RECFM=VS, the length can exceed BLKSIZE.
LRECL=0 is valid only for RECFM=U.
Example 1:

//DD01 DD DSNAME=MTH.DATA,DISP=(NEW,KEEP),
// RECFM=FB,LRECL=625
In the above example, the logical record length of 625 is used for the new
data set MTH.DATA.

Example 2:

//DD01 DD DSNAME= MTH.DATA,DATACLAS=DCLAS07,DISP=(NEW,KEEP),


// LRECL=625

In the above example, the logical record length of 625 overrides the logical
record length defined in the data class for the data set.

JCL DD OUTLIM
JCL – DD LRECL
JCL – DD RECFM

OUTLIM parameter used to limit the logical records number in the SYSOUT
dataset for the specified DD statement.
If the limit specified with OUTLIM reached, the system checks for installation-
written routine to determine whether to terminate the job or increase the limit.
If the installation does not supply a routine, the system terminates the job.
OUTLIM is valid only on DD statement with a SYSOUT statement.

Syntax:

OUTLIM=number

number Specifies the number of logical records.

The number is 1 through 8 decimal digits.

The value from 1 through 16777215.

Defaults and overrides:


If no OUTLIM parameter is specified or OUTLIM=0 is coded, JES3 uses an
installation default specified at initialization.
If output is not limited by JES control statements, JES3 uses an installation
default specified at initialization.
In the above both cases, JES2 provides no installation default at initialization.

Example:

//OUTPUT DD SYSOUT=P,OUTLIM=700

The limit for the number of logical records is 700.

JCL DD RECFM
JCL – DD OUTLIM
JCL – DD RECORG

RECFM parameter used to specify the record format and characteristics in


the new dataset.
All the format and characteristics must be specified in one place only.
RECFM is an optional parameter.
Code RECFM parameter only when to specify record format of the new
dataset or to override the record format specified in Data class.

Syntax: BDAM access method:

RECFM= {U }
{V }
{VS }
{VBS}
{F }
{FT }

Default: undefined-length, unblocked records.

U Specifies the records are undefined length.

V Specifies the records are variable length.


VS Specifies the records are variable length and spanned.

VBS Specifies the records are variable length, blocked and spanned.

The problem program must block and segment the records.

F Specifies the records are fixed length.

T Specifies the records may be written using the track-overflow


feature.

Syntax: BPAM Access Method

RECFM= {U } [A]
{UT } [M]
{V }
{VB }
{VS }
{VT }
{VBS }
{VBT }
{VBST}
{F }
{FB }
{FT }
{FBT }

Default: U

A Specifies the records contain ISO/ANSI control characters.

B Specifies the records are blocked.

F Specifies the records are fixed length.

M Specifies the records contain machine code control characters.


T Specifies the records may be written using the track-overflow
feature.

U Specifies the records are undefined length.

V Specifies the records are variable length.

Syntax: BSAM, EXCP, and QSAM Access Methods

RECFM= {U } [A]
{UT } [M]
{F }
{FB }
{FS }
{FT }
{FBS }
{FBT }
{V }
{VB }
{VS }
{VT }
{VBS }
{VBT }
{VBST}

Default: U

A Specifies the records contain ISO/ANSI control characters.

B Specifies the records are blocked.

D Specifies the records are variable-length ISO/ANSI tape records.

F Specifies the records are fixed length.

M Specifies the records contain machine code control characters.


S (1) For fixed-length records, indicates that the records are written
as standard blocks, (2) For variable-length records, indicates that
a record can span more than one block.

T Specifies the records can be written using the track-overflow


feature, if required.

U Specifies the records are undefined length.

V Specifies the records are variable length.

Note:
A or M can be coded with any record format, such as: RECFM=FBA
Example 1:

//DD01 DD DSNAME=MTH.DATA,DISP=(NEW,KEEP),
// RECFM=FB,LRECL=625

In the above example, the record format of fixed block (FB) is used for the
new data set MTH.DATA.

Example 2:

//DD01 DD DSNAME=MTH.DATA,DATACLAS=DCLAS07,DISP=(NEW,KEEP),
// RECFM=FB

In the above example, the record format of fixed block (FB) overrides the
record format defined in the data class for the data set.

JCL DD RECORG
JCL – DD RECFM
JCL – DD RETPD

RECORG parameter used to specify the organization of the records in the


new dataset.
RECORG parameter can be used with SMS only.
RECORG is an optional parameter.
Code RECORG parameter only when to specify record organization of the
new dataset or to override the record organization specified in Data class.
If SMS is not installed or is not active, the system syntax checks and then
ignores the RECORG parameter.

Syntax:

{KS}
RECORG= {ES}
{RR}
{LS}

KS Specifies a VSAM Key-Sequenced dataset.

ES Specifies a VSAM Entry-Sequenced dataset.

RR Specifies a VSAM Relative Record dataset.

LS Specifies a VSAM Linear Space dataset.

Defaults and Overrides:


If RECORG not specified, SMS assumes a physical sequential (PS) or
partitioned (PO) data set.
If RECORG parameter specified, it overrides the record organization defined
in the DATACLAS for the data set.

Example 1:

//DD01 DD DSNAME=MTH.DATA,DISP=(NEW,KEEP)

In the above example, the RECORG parameter not specified. The SMS
assumes that MTH.DATA is a physical sequential (PS) or partitioned (PO)
data set.

Example 2:

//DD01 DD DSNAME=MTH.DATA,DATACLAS=DCLAS07,DISP=(NEW,KEEP),
// RECORG=KS
In the example, the record organization of key-sequenced (KS) overrides the
record organization defined in the data class.

JCL DD RETPD
JCL – DD RECORG
JCL – DD SPACE

RETPD parameter used to specify the retention period for the new dataset.
This helps to reduce the risk of deleting the dataset accidentally.
The dataset can be deleted or written over after the retention period is
completed.
RETPD is optional parameters.
Do not specify the RETPD parameter for temporary datasets.
Code RETPD parameter only when to specify record retention period of the
new dataset or to override the retention period specified in Data class.
RETPD parameter achieves the same result as EXPDT parameter.

Syntax:

RETPD=nnnnn

nnnnn Specifies the retention period in days for the new dataset.

The nnnnn is 1 through 5 decimal digits.

The nnnnn value is from 0 through 93000.

The calculated expiration date uses 365-day years and 366-


day leap years.

If the produced expiration date exceeds December 31, 2155,


then the expiration date will be set to December 31, 2155.

Example 1:

//DD01 DD DSNAME=MTH.DATA,DISP=(NEW,KEEP),RETPD=150
In the above example, the data set is not eligible for being deleted or written
over for 150 days.

Example 2:

//DD02 DD DSNAME=MTH.DATA,DATACLAS=DCLAS07,DISP=(NEW,KEEP),
// RETPD=625

In the above example, the retention period of 625 days overrides the retention
period defined in the data class for the data set.

JCL DD SPACE
JCL – DD RETPD
JCL – DD SYSOUT

SPACE parameter used to request a space for new dataset.


The space should be requested on direct access volume.
SPACE parameter can also override space allocated for the dataset which is
already created.
It can extend the space allocation for the dataset already created.
SPACE parameter has no advantage of using it for TAPE devices.
SPACE is optional parameter.

Syntax:

SPACE= ({TRK,}(primary-qty[,second-qty][,directory])[,RLSE]
[,CONTIG][,ROUND])
({CYL,} [, ] [, ][,MXIG
]
({blklgth,} [,ALX
]
({reclgth,} [,
]

TRK/CYL:

Request the space in tracks or cylinders.

Block-length (blklgth):
Block length is used to specify the average block length in bytes.
Block length used to specify only when AVGREC parameter is not coded.
Block length allows from 0 through 65535.
Block length will get priority when BLKSIZE also specified in DCB parameter.

Record length (reclgth):

Record length is used to specify the average record length in bytes.


Record length used to specify only when AVGREC is coded with SMS active.
Record length allows from 0 through 65535.

Primary Qty (primary-qty):

Specifies the amount of primary space required for the data set.
Primary qty always be in terms of TRKS, CYLS, Block length and record
length.
The specified volume must have enough space available which is requested
in Primary. If enough space not available, the allocation job will be terminated.
Primary qty allows values from 0-16777215.
If block length specified as ZERO, then one of the below will consider as
block size
• Block size from the DCB parameter.
• Block size determined from RECFM and LRECL on the DD Statement.
• Default value of 4096.

Secondary Qty (secondary-qty):

Specifies the amount of additional space required for the data set.
Secondary qty always be in terms of TRKS, CYLS, Block length and record
length.
System will not allocate the secondary space, until it is needed.
Secondary qty allows values from 0-16777215.
If block length specified as ZERO, then one of the below will consider as
block size.

• Block size from the DCB parameter


• Block size determined from RECFM and LRECL on the DD Statement
• Default value of 4096.

Secondary Qty is used to extend the memory for the datasets which are
already created.
The extension can be done in below ways.
1. If the DISP used as NEW or MOD, then the system trying to allocate the
extended memory on the same volume itself.
2. If the DISP used as OLD or SHR and no another volume specified
during the allocation, then the system trying to allocate the extended
memory on the same volume itself.
3. If the DISP used as OLD or SHR and another volume specified during
the allocation, then the system trying to allocate the extended memory
on the another volume specified.

Directory:

Specifies the number of 256-byte records needed in the directory.


The directory is for partitioned data set (PDS) or partitioned data set extended
(PDSE).
Directory allows values from 0-16777215.
The directory needs to specify during the PDS creation.

RLSE:

RLSE releases the memory allocated to the dataset when the dataset is
closed.
RLSE function notifies the close function to release unused space on the
dataset closes.
RLSE function supports sequential, partitioned and VSAM.
If RLSE function specified and an abnormal termination occurs, the system
does not release unused space even though the data set is open.
RLSE function does not affect primary and secondary allocation.
If the system can’t able to get the exclusive control of the dataset while
closing the dataset, the system ignores a request to release unused space.

CONTIG:

CONTIG parameter specifies the memory allocated should be contagious.


CONTIG parameter applicable for primary memory allocation.
If the CONTIG option specified during the allocation and no contiguous space
available then JOB will be terminated.

MXIG:

MXIG parameter specifies that the memory allocation should be done on the
largest contiguous memory location.
If no contiguous memory location available, the system will check for primary
quantity contiguous memory available at least.
MXIG parameter applicable only for primary memory allocation.

ALX:

ALX parameter specifies to the system that the memory to the dataset
allocation is to up to 5 largest available locations on the same volume.
Each of the 5 areas size should be greater than or equal to primary quantity.
ALX parameter applicable only for primary memory allocation.

ROUNDED:

ROUNDED parameter only applicable when average block length specified.


ROUNDED parameter specifies that the memory allocation to the data set
should be equal to the number specified in average block.
If TRK and CYLs specified, ROUNDED parameter will be ignored.

Example 1:

//DD01 DD DSNAME=&&TEMPMTH,SPACE=(CYL,10)

The DD statement defines a temporary data set.

Example 2:

//DD02 DD DSNAME=MTH.DATA,DISP=(,KEEP),UNIT=3390,
// SPACE=(CYL,(10,,10),,CONTIG)

The system allocates 10 cylinders to the data set and the system allocates 10
contiguous cylinders on the volume because of the CONTIG sub parameter.

Example 3:

//DD01 DD DSNAME=MTH.DATA,DISP=NEW,UNIT=3390,
// SPACE=(ABSTR,(5,1))

In the above example, the SPACE parameter asks the system to allocate 5
tracks, beginning on the second track of the volume.

Example 4:

//DD01 DD DSNAME=MTH.DATA,DATACLAS=DCLAS07,DISP=(NEW,KEEP),
// SPACE=(256,(10,5)),AVGREC=K
In this example, the space allocation defined in the DCLAS07 data class is
overridden by the SPACE and AVGREC parameters.

JCL DD SYSOUT
JCL – DD SPACE
JCL – DD UNIT

SYSOUT parameter used to identify the dataset as a system output dataset.


Normally this called as a SYSOUT dataset.
Do not use SYSOUT with SMS managed dataset.
SYSOUT mostly used to view the system ABEND codes information and
output of the display statement.
SYSOUT mostly used to route the COBOL program's DISPLAY statements.
SYSOUT is always allocated and gets all the output from the System level
process (including any messages about the JCL itself, performance stats,
error messages etc.)
SYSOUT parameter used to direct the output device and generate during
execution of the job to an output device.
SYSOUT can write all these messages to dataset as well.
The SYSOUT parameter can also:

1. Assigns this sysout data set to an output class.


2. Optionally requests an external writer to process the sysout data set.
3. Optionally identifies the forms on which the data set is to be printed or
punched.

Syntax:

SYSOUT= { class }
{ * }
{ ([class] [,writer-name] [,form-name]) }

SYSOUT=(,)
class Specifies the output class for the data set.

The class is one character.

The class allows A through Z or 0 through 9.

The each output class attributes are defined during JES


initialization.

* Requests the output class in the MSGCLASS parameter


on the JOB statement.

(,) Specifies a null class.

A null class must be coded to use the CLASS parameter


on a OUTPUT JCL statement.

Specifying SYSOUT=(,) nullifies the SYSOUT class.

writer- Specifies the member name.


name
Member name allows 1 to 8 alphanumeric characters.

form- Specifies the print or punch forms.


name
form-name is 1 through 4 characters.

Form-name allows alphanumeric or national ($, #, @)


characters.

Defaults and overrides:


The sysout dataset is processed according to the following override order:

1. The options specified on this sysout DD statement.


2. The options specified on a referenced OUTPUT JCL statement.
3. The options specified on a referenced JES2 OUTPUT statement or on a
JES3 FORMAT statement.
4. The installation default options for the requested output class.
Example 1:

//DD01 DD SYSOUT=P

In the above example, the DD statement specifies that JES is to write the
sysout dataset to the class P output.

Example 2:

//DD2 DD DSNAME=&&TEMP,SYSOUT=P

In this example, the DD statement specifies that JES is to write the data set to
the device handling class P output.

Example 3:

//DD5 DD SYSOUT=(P,,PRT)

In the above example, the DD statement specifies that JES is to write the
sysout data set to the device handling class P output. The data set is to be
printed.

JCL DD UNIT
JCL – DD SYSOUT
JCL – DD VOLUME

UNIT parameter used to ask the system to place the dataset on a specific
device or a group of devices or the same device as another dataset.
UNIT is optional parameter.
UNIT do not required to specify with SMS.
The UNIT parameter can also tell the system how many devices to assign
and request that the system defer mounting the volume until the data set is
opened.

Syntax:

{UNIT=([ddd ] [,unit-count] [,DEFER]) }


[/ddd ] [,P ] [, ]
[/dddd ] [, ]
[device-type ]
[group-name ]

device- Specifies device by a 3-digit or 4-digit hexadecimal number.


number
Precede a 4-digit number with a slash (/).

A 3-digit number can be specified with or without a slash.

device- Specifies a device by its generic name which is an IBM-


type supplied name.

If specify the device-type sub parameter, SMS ignores it.

group- Specifies a group of devices by a symbolic name.


name
The group-name is 1 through 8 alphanumeric characters.

unit- Specifies the number of devices.


count
"Unit-count" is a decimal number from 1 through 59.

P Specifies the system to allocate the same number of devices


from the VOLUME volume-count or SER subparameter,
whichever is higher.

DEFER Specifies the system to assign the dataset to device(s)

Defaults and overrides:


If SYSOUT and UNIT coded on the same statement, the SYSOUT parameter
overrides the UNIT parameter.

Example 1:

//DD01 DD DSNAME=MTH.DATA,DISP=SHR,UNIT=3440

DD statement DD01 requests one 3440 tape device.


Example 2:

//DD01 DD DSNAME=MTH.DATA,DISP=(,KEEP),
// VOLUME=SER=13230,UNIT=3440

This DD statement defines a new data set and requests that the system
assign any 3440 Magnetic Tape Unit.

Example 3:

//DD01 DD DSNAME=MTH.DATA,DISP=SHR,UNIT=(,2)

This DD statement defines a cataloged data set and requests that the system
assign two devices to the data set.

JCL DD VOLUME
JCL – DD UNIT
JCL - STEPLIB

VOLUME parameter used to identify the volume(s) on which the dataset


resides or will reside.
The volume request for new datasets can be private volume, retention of the
volume, volume by serial number or the volume that other datasets uses.
VOLUME is optional parameter.

Syntax:

{VOLUME} = ([PRIVATE] [,RETAIN] [,volume-sequence-number]


[,volume-count]
{VOL } [, ] [, ]

[SER=serial-number ]
[SER=(serial-number[,serial-number]...)]
[,] [REF=dsname ]
[REF=*.ddname ]
[REF=*.stepname.ddname ]
[REF=*.stepname.procstepname.ddname ]

PRIVATE Requests a private volume.


RETAIN RETAIN has no effect on the
handling of direct access volumes.

volume-sequence-number Specifies the volume of an existing


multivolume data set.

The volume sequence number is a


decimal number.

The volume sequence number


from 1 through 255.

The first volume is identified as 1.

The volume sequence number


must be less than or equal to the
number of volumes on which the
data set exists.

If the volume sequence number is


not specified, the system will
process the first volume.

For new data sets, the system


ignores the volume sequence
number.

volume-count Specifies the maximum number of


volumes.

The volume count is a decimal


number from 1 through 255.

The total volume count for all DD


statements in one job step cannot
exceed 4095.
SER=serial-number Specifies the volume serial
SER=(serial-number[,serial- number.
number]...)
A volume serial number is 1
through 6 alphanumeric, national
($, #, @), or special characters.

If the number can be shorter than


6 characters.

User can code a maximum of 255


volume serial numbers on a DD
statement.

The maximum number of volume


serial numbers for a VSAM or
SMS-managed data set is 59.

Do not specify duplicate volume


serial numbers in a SER sub
parameter.

REF=dsname Specifies the system to obtain


REF=*.ddname volume serial numbers from
REF=*.stepname.ddname another dataset or an DD
REF=*.stepname.procstepname. statement.
ddname

*.ddname Specifies the system to obtain the


volume serial numbers from earlier
DD statement.

*.stepname.ddname Specifies the system to obtain the


volume serial numbers from DD
statement in an earlier step
stepname in the same job.
*.stepname.procstepname.ddna Specifies the system to obtain the
me volume serial numbers from a DD
statement in a cataloged or in-
stream procedure.

Example 1:

//DD01 DD DSNAME=MTH.DATA,UNIT=SYSDA,DISP=OLD,
// VOLUME=SER=64887

The DD statement requests an existing data set, which resides on the direct
access volume, serial number 64887.

Example 2:

//DD02 DD DSNAME=MTH.DATA,DISP=(MOD,KEEP),UNIT=(3390,2),
// VOLUME=(,,,4,SER=(64887,64888))

The DD statement requests an existing data set, which resides on two


volumes, serial numbers 64887 and 64888.

Example 3:

//DD3 DD DSNAME=MTH.DATA,UNIT=3390

The DD statement defines a data set that is created and deleted in the job
step and the statement makes a nonspecific volume request because of the
VOLUME parameter ignored.

JCL STEPLIB
JCL – DD VOLUME
JCL JOBLIB

STEPLIB is a private library.


STEPLIB used to specify the private load library where step EXEC program
load resides.
STEPLIB can be placed anywhere in the specific step.
If the system can’t able to find the program in specified library with STEPLIB,
it will start checking in system libraries.
STEPLIB libraries are of type PDS or PDSE on direct access device.
Each member in the PDS is a user written program and executable.
The STEPLIB DD statement is used to identify the program library to search
first when attempting to locate programs that should execute during the job
step execution.
More than one library can be concatenated on the STEPLIB.
If a STEPLIB DD is specified in a job that also has a JOBLIB, the STEPLIB
takes precedence when searching for a program for the particular step.
STEPLIB can be coded in in-stream or cataloged procedures.
STEPLIB is used to specify the library where the currently executing program
load resides.
STEPLIB is used to specify the load library for the specific step under the
step it is coded.
Maximum 255 STEPLIBs can be coded in the JOB.
If more than one loadlib provided in STEPLIB, the order of searching for the
load by the system is same as how they coded in STEPLIB.

Syntax:
//STEPLIB DD parameter[,parameter]... [comments]

Private library is the library where the program executable placed.

Example 1:

//STEP01 EXEC PGM=PROG1


//STEPLIB DD DSNAME=MTH.LOADLIB1,DISP=SHR
//STEP02 EXEC PGM=PROG2
//STEPLIB DD DSNAME=MTH.LOADLIB2,DISP=SHR

The system searches MTH.LOADLIB1 for the program PROG1 and


MTH.LOADLIB2 for PROG2.

Example 2:

//STEP2 EXEC PGM=PROG1


//STEPLIB DD DSNAME=MTH.LOADLIB1,DISP=SHR
// DD DSNAME=MTH.LOADLIB2,DISP=SHR

The system searches MTH.LOADLIB1 and MTH.LOADLIB2 for the program


PROG1 for PROG2.

Example 3:
//JOBLIB DD DSNAME=MTH.JLOADLIB,DISP=SHR
//STEP01 EXEC PGM=PROG1
//STEPLIB DD DSNAME=MTH.LOADLIB,DISP=SHR
//STEP2 EXEC PGM=PROG2

The system searches MTH.LOADLIB for the program PROG1. The system
searches MTH.JLOADLIB for PROG2 as no STEPLIB defined for it.

JCL JOBLIB
JCL STEPLIB
JCL JCLLIB

JOBLIB is a private library.


JOBLIB used to specify the private library where the step EXEC program load
resides.
JOBLIB libraries are of type PDS or PDSE on direct access device.
Each member in the PDS is a user written program and executable.
The JOBLIB DD statement is used to identify the program library to search
first when attempting to locate programs that should execute during the job
execution.
The JOBLIB should be placed in between the JOB Card and first EXEC
statement.
More than one library can be concatenated on the JOBLIB.
If a STEPLIB DD is specified in a job that also has a JOBLIB, the STEPLIB
takes precedence when searching for a program.
JOBLIB should not be coded in in-stream or cataloged procedures.
JOBLIB is used to specify the library where the programs load resides that
are all executing in the JOB.
This JOBLIB will be used to specify the load library if it is the load library for
more than one program in the entire JCL.
If more than one loadlib provided in JOBLIB, the order of searching for the
load by the system is same as how they coded in JOBLIB.

Syntax:
//JOBLIB DD parameter[,parameter]... [comments]

Private library is the library where the program executable placed.

Example 1:
//JOBLIB DD DSNAME=MTH.JLOADLIB,DISP=SHR
//STEP1 EXEC PGM=PROG1
//STEP2 EXEC PGM=PROG2

The system searches for the programs PROG1 and PROG2 first in
MTH.JLOADLIB, then in SYS1.LINKLIB.

Example 2:

//JOBLIB DD DSNAME=MTH.LOADLIB1,DISP=SHR
// DD DSNAME=MTH.LOADLIB2,DISP=SHR
//STEP1 EXEC PGM=PROG1
//STEP2 EXEC PGM=PROG2

The system searches MTH.LOADLIB1 and MTH.LOADLIB2 for the program


PROG1 for PROG2.

Example 3:

//JOBLIB DD DSNAME=MTH.JLOADLIB,DISP=SHR
//STEP01 EXEC PGM=PROG1
//STEPLIB DD DSNAME=MTH.LOADLIB,DISP=SHR
//STEP2 EXEC PGM=PROG2

The system searches MTH.LOADLIB for the program PROG1. The system
searches MTH.JLOADLIB for PROG2 as no STEPLIB defined for it.

JCL JCLLIB
JCL JOBLIB
JCL PROCLIB

JCLLIB Statement used mainly for:

• To identify the names of the private libraries that the system uses for the
job. Two major things that the system searches in the libraries for
◦ Procedures on any EXEC statements.
◦ Groups of JCL statements on any INCLUDE statements.
• To identify the system and installation-defined procedure libraries that
the system uses for the job.
JCLLIB identify the order in which the libraries are to be searched.
The system searches the libraries in the same order which specified on the
JCLLIB statement.
The JCLLIB statement allows to code, use procedures and INCLUDE groups
in private library.
The private library is in the place of system procedure libraries.
The usage of system procedure libraries is not mandatory.
Maximum one JCLLIB can be coded per one JOB.

Syntax:

//[name] JCLLIB [keyword-parameter]... [comments]

The JCLLIB statement consists of the characters // in columns 1 and 2 as


usual.
The other is name, operation (JCLLIB), keyword parameter (ORDER) and
comments.
If only one library is listed in the search order, the parentheses are optional.
If the libraries are more than one then those needs to be coded in more than
one line and the second line beginning in any column from 4 to 16.
JCLLIB is a JCL statement that allows the user to specify his own PROCLIBs
and/or specify the order in which they're searched to find the PROCEDURES
invoked in the JCL.
JCLLIB is a JCL keyword used for defining the Catalogued procedure.

name:
Name is optional on a JCLLIB statement.
If a name is not coded, column 3 must be blank.
If the name is coded, below are the rules.

Rules:

Name always begins in the column 3 and column 1 & 2 contains ‘//’.
name is 1 through 8 characters.
name is a combination of alphanumeric and national characters (@,# and $).
name first character should be alphabetic or national character.
name must be followed by one blank before DD.

Operation:
Operation field consists of JCLLIB characters.
Operation field can start in any column.
Operation field must be followed by one blank.

Parameters:
ORDER=(library[,library...])

Specifies the name of the libraries to be searched.


The maximum number of libraries that may be specified is 15.
User can specify private libraries, system and installation-defined procedure
libraries.
The system searches the libraries in the order in how they specified.
The ORDER parameter can be specified only once.
Do not specify is a temporary data set (&&dsname).

PROCLIB=ddname

Specifies the ddname for the procedure library.


The system is to search for cataloged procedures called by EXEC statements
in the job.
If the procedure library requested is not found, JES3 flushes the job before
execution.

Comment:
Comment used to make a note of current statement.
Comment field follows parameter field.
Comment field should be preceded with a blank after the parameter field.

Example 1:

//MYLIBS JCLLIB ORDER=MTH.PROCLIB


//STEP01 EXEC PROC=MTHPROC

The system searches the libraries for procedure MTHPROC in the following
order:

1. MTH.PROCLIB
2. SYS1.PROCLIB

Example 2:
//MYLIBS JCLLIB ORDER=(MTH.PROCLIB1,MTH.PROCLIB2,
// MTH.PROCLIB3)
//STEP01 EXEC PROC=MTHPROC

The system searches the libraries for procedure MTHPROC in the following
order:

1. MTH.PROCLIB1
2. MTH.PROCLIB2
3. MTH.PROCLIB3
4. SYS1.PROCLIB

Example 3:

//MYLIBS JCLLIB ORDER=(SYS1.PROCLIB,MTH.PROCLIB1)


//STEP01 EXEC PROC=MTHPROC

The system searches the libraries for procedure MTHPROC in the following
order:

1. SYS1.PROCLIB
2. MTH.PROCLIB1
3. SYS1.PROCLIB (searched again the system default procedure library)

JCL PROCLIB
JCL JCLLIB
JCL COPYLIB

PROCLIBs are Procedure Libraries.


These may be system or user PROCLIBs.
PROCLIB will specify the library where the procedures existed.
This will be used when the catalog procedures are coded in the JCL.

Syntax:
//[name] JCLLIB PROCLIB=ddname... [comments]

Specifies the ddname for the procedure library.


The system is to search for cataloged procedures called by EXEC statements
in the job.
If the procedure library requested is not found, JES3 flushes the job before
execution.

Example 1:

//MYLIBS JCLLIB ORDER=MTH.PROCLIB


//STEP01 EXEC PROC=MTHPROC

The system searches the libraries for procedure MTHPROC in the following
order:

1. MTH.PROCLIB
2. SYS1.PROCLIB

Example 2:

//MYLIBS JCLLIB ORDER=(MTH.PROCLIB1,MTH.PROCLIB2,


// MTH.PROCLIB3)
//STEP01 EXEC PROC=MTHPROC

The system searches the libraries for procedure MTHPROC in the following
order:

1. MTH.PROCLIB1
2. MTH.PROCLIB2
3. MTH.PROCLIB3
4. SYS1.PROCLIB

Example 3:

//MYLIBS JCLLIB ORDER=(SYS1.PROCLIB,MTH.PROCLIB1)


//STEP01 EXEC PROC=MTHPROC

The system searches the libraries for procedure MTHPROC in the following
order:

1. SYS1.PROCLIB
2. MTH.PROCLIB1
3. SYS1.PROCLIB (searched again the system default procedure library)
JCL COPYLIB
JCL PROCLIB
JCL - SYSABEND

COPYLIB is a private library specifies that where the copy books are
available.
COPYLIB libraries are of type PDS.
Each member in the PDS is a user written COBOL source code which is a
part of actual program.
COPYLIB can be used to search the copy books used in the library during the
compilation of the program.
A COPY statement can copies the source code from library to program.
COPYLIB can be coded during the compilation time and along with
compilation step.

Syntax:
//COPYLIB DD DSN=copybook-library

If the COPY control statement used enter the COPYLIB DD statement.


The COPYLIB DD statement contains control statement members selected
by COPY control statement.

JCL SYSABEND Statement


JCL - COPYLIB
JCL SYSMDUMP

SYSABEND DD statement used to direct the system to produce dump.


System produces the dump when the job abends abnormally.
If the JOB successfully completed, then system will not generate any dump
even though SYSABEND coded.
SYSABEND dumps for system and user areas.
SYSABEND can also dump the input output control blocks for failed task.
SYSABEND is used to dump the contents of various registers variables,
datasets accessed and The Nucleus at the time of abnormal termination.
The dump will be in hexadecimal format.
SYSABEND is the dd name which contains a summary dump for the failing
program.

Syntax:
//SYSABEND DD parameter[,parameter]... [comments]

Do not place two DD statements with the same dump ddname.

Example:

//STEP2 EXEC PGM=PROG1


//SYSABEND DD DSNAME=MTH.SYSABEND,DISP=(OLD,DELETE,KEEP)

SYSABEND DD statement specifies that the dump is to be stored. If the step


successfully execute, the second DISP sub parameter DELETE in STEP2
instructs the system to delete the data set and free the space acquired for
dumping.

JCL SYSMDUMP Statement


JCL SYSABEND Statement
JCL SYSUDUMP Statement

SYSMDUMP DD statement used to direct the system to produce dump.


System produces the dump when the job abends abnormally.
If the JOB successfully completed, then system will not generate any dump
even though SYSMDUMP coded.
SYSMDUMP produces a dump of the system areas and the program's
address space.
The dump is unformatted and machine-readable;
SYSMDUMP dumps are the only ABEND dumps.

Syntax:

//SYSMDUMP DD parameter[,parameter]... [comments]

Do not place two DD statements with the same dump ddname.

Example:

//STEP EXEC PGM=PROG1


//SYSMDUMP DD UNIT=3390,VOLUME=SER=3456,SPACE=(CYL,(0,1)),
// DISP=(NEW,DELETE,KEEP),DSNAME=MTH.MDUMP

The SYSMDUMP DD statement allocates dump data set MTH.MDUMP to a


direct access device.

JCL SYSUDUMP Statement


JCL SYSMDUMP Statement
JCL SYSIN Statement

SYSUDUMP DD statement used to direct the system to produce dump.


System produces the dump when the job abends abnormally.
If the JOB successfully completed, then system will not generate any dump
even though SYSUDUMP coded.
SYSUDUMP produces a dump of user areas.
The dump is formatted and readable.
SYSUDUMP dumps are the only user ABEND dumps.

Syntax:

//SYSUDUMP DD parameter [comments]

Do not place two DD statements with the same dump ddname.

Example:

//STEP2 EXEC PGM=PROG1


//SYSUDUMP DD SYSOUT=P

The SYSUDUMP DD statement specifies that the dump routed to system


output class P.

JCL SYSIN Statement


JCL SYSUDUMP
JCL REFERBACK

SYSIN statement used to start an instream data set.


SYSIN card is used to send vast input data to the program using the JCL.
Data can be accepted in the program through ACCEPT statement.
One row in the SYSIN will be equal to one ACCEPT in the program.
/* known as delimiter and by using /* we can end the instream data.
Delimiter (/*) is mandatory with SYSIN.
Delimiter (/*) always starts at column1 and ends at column2.
If both PARM & SYSIN DD* in one JCL, the first preference is for PARM
parameter and after SYSIN DD*.
In-stream data sets begin with a DD * or DD DATA statement.

Syntax:

//SYSIN DD parameter[,parameter]... [comments]

The first parameter is an * or DATA to specify that an in-stream data set


follows immediately.
Do not code a symbolic in place of the * or DATA positional parameter on a
SYSIN type DD statement.
Below example shows show the SYSIN data accepted in the program.
JCL:

=COLS> ----+----1----+----2----+----3----+----4----+----5----
+----6----+----7--
****** ***************************** Top of Data
******************************
000001 //MTHUSERJ JOB (META007),'PAWAN
Y',CLASS=A,MSGCLASS=L,MSGLEVEL=(1,1),
000002 // TIME=1440,NOTIFY=&SYSUID
000003 //*
000004 //JOBLIB DD DSN=MTHUSER.MY.LOADLIB,DISP=SHR
000005 //*
000006 //STEP01 EXEC PGM=DATECONV
000007 //STEPLIB DD DSN=MTHUSER.TEST.LOADLIB,DISP=SHR
000008 //SYSIN DD *
000008 20160101
000008 /*
000009 //OUTFILE DD DSN=MTHUSER.EXAMPROG.OUTPUT,
000010 // DISP=(NEW,CATLG,DELETE),
000011 // UNIT=(SYSDA,20),
000012 // SPACE=(CYL,(50,25)),
000013 // DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,BUFNO=2)
000014 //*
000015 //SYSPRINT DD SYSOUT=*
000016 //SYSUDUMP DD SYSOUT=*
000017 //SYSOUT DD SYSOUT=*
****** **************************** Bottom of Data
****************************

Program:

IDENTIFICATION DIVISION.
PROGRAM-ID. DATECONV.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.

01 WS-DT-INP PIC 9(08).


01 WS-DT-OP1 PIC 9(07).
01 WS-DT-OP2 PIC 9(08).

PROCEDURE DIVISION.
0000-MAINLINE SECTION.

ACCEPT WS-DT-INP.

COMPUTE WS-DT-OP1 = FUNCTION DAY-OF-INTEGER (FUNCTION


INTEGER-OF-DATE (WS-DT-INP) - 1)

COMPUTE WS-DT-OP2 = FUNCTION DATE-OF-INTEGER (FUNCTION


INTEGER-OF-DATE (WS-DT-INP) - 1)
DISPLAY 'DATE OUTPUT1 : ' WS-DT-OP1.

DISPLAY 'DATE OUTPUT2 : ' WS-DT-OP2.

STOP RUN.

JCL REFERBACK Statement


JCL - SYSIN
JCL - If Statement

The backward reference or refer back is used to get the information from the
previous step to the current step to reduce the redundant coding.
STAR (*) is used as refer back operator.

Syntax:

*.DDNAME Referring the DDNAME from previous


step.

*.STEPNAME.DDNAME Referring the particular step’s DDNAME


from previous steps.

*.PROC-NAME.DDNAME Referring the DDNAME from PROC which


has only one step.

*.PROC- Referring the particular step’s DDNAME


NAME.STEPNAME.DDN from the PROC.
AME

Example 1:

//STEP01 EXEC PGM=PROG


//INPUT DD DSN=MTH.INPUT.FILE,DISP=SHR
//OUTPUT DD DSN=MTH.OUTPUT.FILE,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,10),RLSE),
// DCB=*.INPUT
In the above example, the DCB information is copied from input file
MTH.INPUT.FILE.

Example 2:

//STEP01 EXEC PGM=PROG1


//INPUT DD DSN=MTH.INPUT.FILE,DISP=SHR
//OUTPUT DD DSN=......
//STEP02 EXEC PGM=PROG2
//INPUT DD DSN=......
//OUTPUT DD DSN=MTH.OUTPUT.FILE,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,10),RLSE),
// DCB=*.STEP01.INPUT

In the above example, the DCB information is copied from input file
MTH.INPUT.FILE which is specified in STEP01.

Example 3:

//STEP01 EXEC PROC=MTHPROC


//STEP03 EXEC PGM=PROG3
//STEP04 EXEC PGM=PROG4
//INPUT DD DSN=......
//OUTPUT DD DSN=MTH.OUTPUT.FILE,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,10),RLSE),
// DCB=*.MTHPROC.INPUT

MTHPROC:

//MTHPROC
//STEP02 EXEC PGM=PROG2
//INPUT DD DSN=MTH.INPUT.FILE,DISP=SHR

In the above example, the DCB information is copied from input file
MTH.INPUT.FILE which is specified in MTHPROC.

Example 4:

//STEP01 EXEC PROC=MTHPROC


//STEP03 EXEC PGM=PROG3
//STEP04 EXEC PGM=PROG4
//INPUT DD DSN=......
//OUTPUT DD DSN=MTH.OUTPUT.FILE,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,10),RLSE),
// DCB=*.MTHPROC.STEP03.INPUT

MTHPROC:

//MTHPROC
//STEP02 EXEC PGM=PROG2
//INPUT DD DSN=......
//OUTPUT DD DSN=......
//STEP03 EXEC PGM=PROG3
//INPUT DD DSN= MTH.INPUT.FILE,DISP=SHR
//OUTPUT DD DSN=......

In the above example, the DCB information is copied from input file
MTH.INPUT.FILE which is specified in STEP03 of MTHPROC.

JCL IF Statement
JCL - REFERBACK
JCL - Procedures

IF statement used to construct the job execution in conditional way.


IF statement used to construct to execute conditionally execute the job steps
within the job.
IF/THEN/ELSE/ENDIF statement can have up to 15 levels internally.
IF statement validates the return code of the previous step(s).
The previous step may not be the immediate preceding step of IF condition.
THEN is mandatory along with IF statement.
ELSE with THEN is optional with IF condition.
ENDIF is mandatory along with IF condition.
Every IF condition coded in JCL should end with ENDIF.
IF statement always followed by a relational expression followed by THEN.

Syntax:

//[name] IF [(]relational-expression[)] THEN [comments]


.
. Set of statements for condition true
.
//[name] [ELSE [comments]]
.
. Set of statements for condition false
.
//[name] ENDIF [comments]

IF statement can be divided into the below parts.

• name
• Operation
• Relational expression
• Comment

Note:
Do not code comment if the parameter field is blank.

name:
name is optional on IF/THEN, ELSE, and ENDIF statements.
name must be unique within the job step.
name can be ignored/omitted from the second dataset, if all the datasets are
used for concatenation.

Rules:

Name always begins in the column 3 and column 1 & 2 contains ‘//’.
name is 1 through 8 characters.
name is a combination of alphanumeric and national characters (@,# and $).
name first character should be alphabetic or national character.
name must be followed by one blank before DD.

Operation:
Operation field describes about the type of operand.
Operation field consists of IF, ELSE, or ENDIF characters.
Operation field can start in any column.
Operation field must be followed by one blank.

Parameters:
Relational expression followed by IF condition with a blank in between.
Relational expression indicates the condition that the system evaluates.
If the expression exceeds single line, continue the expression beginning in
column 4 through 16 of the next statement.
Relational-expression consists of:
• Comparison operators
• Logical operators
• NOT (¬) operators
• Relational-expression keywords
• Numeric values

Operation field consists of IF, ELSE, or ENDIF characters.

Comment:
Comment used to make a note of current statement.
Comment field follows parameter field.
Comment field should be preceded with a blank after the parameter field.

Example 1:

//IFSTEP2 IF (ABEND | STEP1.RC > 8) THEN


or
//IFSTEP2 IF (ABEND OR STEP1.RC GT 8) THEN

The above example shows the use of the alphabetic characters rather than
special characters for comparison operators.

Example 2:

//STEP01 EXEC PGM=MTHPROG


.
.
//IFSTEP IF (ABEND | STEP1.RC > 8) THEN
//STEP02 EXEC PROC=MTHPROC
//IFSTEPE ENDIF

The IF statement named IFSTEP invokes procedure MTHPROC if either an


abend has occurred or returned a return code that is greater than 8 on a
previous step of the job.

Example 3:

//STEP1 EXEC PGM=...


//IFTEST IF ¬ABEND THEN
//STEP2 EXEC PGM=...
//STEP3 EXEC PGM=...
// ELSE
//STEP4 EXEC PGM=...
// ENDIF

If STEP1 does not abend, STEP2, STEP3 still runs. If STEP1 does abend,
STEP4 is the next step to run as prescribed by the ELSE clause.

Example 4:

//JOBIF JOB RESTART=(STEP3)


//STEP1 EXEC PGM=MTHPROG
//IFTEST IF STEP1.RC=0 | ¬STEP1.RUN THEN
//STEP2 EXEC PGM=...
//STEP3 EXEC PGM=...
//STEP4 EXEC PGM=...
// ELSE
//STEP5 EXEC PGM=...
//STEP6 EXEC PGM=...
//STEP7 EXEC PGM=...
// ENDIF

1. IFTEST will be checked before executing STEP3.


2. STEP1.RC=0 tests false because STEP1 did not execute and cannot
be correctly evaluated.
3. ¬STEP1.RUN tests true; therefore, STEP3 and STEP4 will execute and
STEP5, STEP6, and STEP7 will not execute.

JCL PROC/Procedures
JCL - If Statement
JCL Instream Procedure

Procedures are mainly used to define set of frequently executing job control
statements and will execute wherever it is needed by using the procedure
name.
Procedure provides the user supplied dynamic values to the JCL before
running.
The PROC statement tells the beginning of a procedure.
The PROC statement can assign default values to symbolic parameters, if
coded.
The procedures in JCL are also called as PROCEDURE.

Syntax - For a cataloged procedure:

[//[name] PROC [parameter [comments]]]


//[name] PROC

Syntax - For an in-stream procedure:

//name PROC [parameter [comments]]


//name PROC

PROC statement can be divided into the below parts.

• PROCname
• Operation
• Parameters
• Comment

name:
PROCname is required on a PROC statement in an in-stream procedure.
PROCname is optional on a PROC statement in a cataloged procedure.
If PROCname is not coded, column 3 must be blank.
PROCname naming standards:

Rules:

The PROCname must begin in column 3.


The PROCname of 8 characters length which allows alphabets (A-Z),
numbers (0-9) and $, #, @ characters.
The first character must be alphabet, $, # and @.
The PROCname must be followed by at least one blank.

Operation:
Operation field describes about the type of operand.
Operation is nothing but PROC.
Operation is of length 4 characters.
Operation can be start at any column.

Parameters:
Parameters assign the default values to the symbolic parameters on the
procedure statements.
In-stream PROC statement requires parameters only if the procedure
contains symbolic parameters.
If the parameter field is coded, there should be one blank after Operation
field.

Comment:
Comment used to make a note of current statement.
Comment field follows parameter field.
Comment field should be preceded with a blank after the parameter field.

Example 1:

//STEP1 EXEC PROC=MTHPROC,ACCT=5870

The ACCT keyword parameter will be added on every EXEC statement in the
procedure if the ACCT parameter is not specified in any of the step in
MTHPROC.

Example 2:

//STEP1 EXEC PROC=MTHPROC,ACCT=5870

The ACCT keyword parameter will override ACCT parameter on every EXEC
statement in the procedure if the ACCT parameter is specified in specific the
step in MTHPROC.

Example 3:

//STEP2 EXEC PROC=MTHPROC,ACCT=

The ACCT keyword parameter will nullify the parameter on every EXEC
statement in the procedure.

JCL Instream Procedure


JCL Procedures
JCL Catelog Procedure

If a procedure coded in the job called as Instream Procedure.


The coding of in-stream proc will start with PROC and end with PEND.
Coding PROCLIB is not required because the procedure code exists in the
inside of same JCL.
Instream procedure can’t be coded within another Instream procedure.
Instream procedure definition executes only when we call the procedures.
PEND is mandatory while coding instream procedure.
Instream procedure allows CNTL, comment, DD, ENDCNTL, EXEC, IF/
THEN/ELSE/ENDIF, INCLUDE, OUTPUT JCL, and SET statements only.
Instream procedure will not allow any other statements apart from above.
Instream procedure will not validate for syntax errors until an EXEC statement
calls the procedure.
Up to 15 levels of nesting supports in instream procedure.

Syntax:

//PROC
//……
//PEND

OR

//name PROC [parameter [comments]]


//name PROC

Defaults and Overrides:


To override a default parameter value on a PROC statement, code the same
parameter on the EXEC statement that calls the procedure.
If not coded, the default values coded in PROC statement will get applied.

Example 1:

//STEP01 EXEC PGM=PROG1


//STEPPRC EXEC PROC=MTHPROC
.
.
.
//MTHPROC
//STEP02 EXEC PGM=PROG2
//STEP03 EXEC PGM=PROG3
//PEND

The above example showing the instream procedure definition and execution
within the same job.

Example 2:
//STEP01 EXEC PGM=PROG1
//STEPPRC EXEC PROC=MTHPROC,TIME=(9,30)
.
.
.
//MTHPROC
//STEP02 EXEC PGM=PROG2
//STEP03 EXEC PGM=PROG3
//PEND

In the above example, the TIME statement adds the time to all the steps of
the instream procedure. All the steps in the instream procedure can use the
processor for 9 minutes and 30 seconds.

Example 3:

//STEP01 EXEC PGM=PROG1


//STEPPRC EXEC PROC=MTHPROC,TIME=(9,30)
.
.
.
//MTHPROC
//STEP02 EXEC PGM=PROG2,TIME=(6,30)
//STEP03 EXEC PGM=PROG3
//PEND

In the above example, the TIME statement overrides the TIME values of all
the steps in instream procedure. All the steps in the instream procedure can
use the processor for 9 minutes and 30 seconds.

Example 3:

//STEP01 EXEC PGM=PROG1


//STEPPRC EXEC PROC=MTHPROC,TIME=
.
.
.
//MTHPROC
//STEP02 EXEC PGM=PROG2,TIME=(6,30)
//STEP03 EXEC PGM=PROG3
//PEND

In the above example, the TIME statement nullifies the TIME values of all the
steps in the instream procedure. TIME parameter values in procedure can be
ignored and TIME parameter default value 1440 applied to the entire job.
JCL Catalog Procedure
JCL Instream Procedure

Procedure included from another place called as catalog procedure.


A procedure that cataloged in a library is called a cataloged procedure.
It may be a personal library or system library.
The library is of type PDS/PDSE.
The name of the catalog procedure is a member name or alias name in the
library.
Procedure always defined outside of the JCL in catalog procedure.
PEND is not mandatory in catalog procedure.
Catalog procedure allows CNTL, command, DD, ENDCNTL, EXEC, IF/THEN/
ELSE/ENDIF, INCLUDE, OUTPUT JCL, and SET statements only.
The system procedure library is SYS1.PROCLIB and may change the library
name based on the installation.
Maximum 255 procedures can be defined in the single job.
PROCLIB is mandatory to provide the library to the JCL where the catalog
procedures are placed.
Catalog procedure can be coded within the Catalog procedure.
To call Catalog procedure, the name of the procedure should be coded at
EXEC PROC.
Catalog procedure is not verified for syntax errors until an EXEC statement
that calls the procedure.
When a cataloged procedure is called, the calling step receives a copy of the
procedure

Syntax:

//[name] PROC [parameter [comments]]


//[name] PROC

Defaults and Overrides:


To override a default parameter value on a PROC statement, code the same
parameter on the EXEC statement that calls the procedure.
If not coded, the default values coded in PROC statement will get applied.

Example 1:
//STEP01 EXEC PGM=PROG1
//STEPPRC EXEC PROC=MTHPROC

MTHPROC:

//MTHPROC
//STEP02 EXEC PGM=PROG2
//STEP03 EXEC PGM=PROG3

The above example showing the catalog procedure definition and execution
within the same job.

Example 2:

//STEP01 EXEC PGM=PROG1


//STEPPRC EXEC PROC=MTHPROC,TIME=(9,30)

MTHPROC:

//MTHPROC
//STEP02 EXEC PGM=PROG2
//STEP03 EXEC PGM=PROG3

In the above example, the TIME statement adds the time to all the steps of
the catalog procedure. All the steps in the catalog procedure can use the
processor for 9 minutes and 30 seconds.

Example 3:

//STEP01 EXEC PGM=PROG1


//STEPPRC EXEC PROC=MTHPROC,TIME=(9,30)

MTHPROC:

//MTHPROC
//STEP02 EXEC PGM=PROG2
//STEP03 EXEC PGM=PROG3

In the above example, the TIME statement overrides the TIME values of all
the steps in catalog procedure. All the steps in the catalog procedure can use
the processor for 9 minutes and 30 seconds.

Example 4:

//STEP01 EXEC PGM=PROG1


//STEPPRC EXEC PROC=MTHPROC,TIME=

MTHPROC:

//MTHPROC
//STEP02 EXEC PGM=PROG2
//STEP03 EXEC PGM=PROG3

In the above example, the TIME statement nullifies the TIME values of all the
steps in the catalog procedure. TIME parameter values in procedure can be
ignored and TIME parameter default value 1440 applied to the entire job.