You are on page 1of 207

JOB CONTROL

LANGUAGE(JCL)
Objectives
• Focus of this course is to effectively convey the JCL concepts and
fundamentals
• Intended to provide the benefits.
– Competence with the tools and utilities used
with JCL
– Ability to setup and execute jobs successfully
Expectation
It’s a 7 unit training course designed to demand approximately 9
hrs
of training time
Prerequisites
• Basic knowledge of mainframe concepts
• Dependency
• This course is intended to be after TSO/ISPF and Cobol sessions
and before VSAM session.
Course Outline
MODULE1
• Introduction - Job Control
Language
• Basic Terminology & JCL
Statement Format
• Positional vs Keyword Parameters
• Relationship of Job Control
Language to the operating system
Course Outline (Contd)
MODULE2
• Job statement
• Positional Parameters in JOB statement - Accounting & Programmer
• Keywords Parameters on the JOB statement - MSGLEVEL,
MSGCLASS, CLASS
• MSGLEVEL
• MSGCLASS
• NOTIFY
• TIME
• REGION
• RESTART
• TYPRUN
Course Outline (Contd)
MODULE 3
• Basic Terminology & JCL statement format
• Positional Parameters - PGM, PROC
• Keywords Parameters -TIME,REGION
• Parameters -PARM

MODULE 4
• DD Statement
• Positional Parameters on DD Statement
• Keyword Parameters - DSN, DISP, DCB
• Keyword Parameters- VOL,LABEL,UNIT
• SPACE Parameter
Course Outline(Contd)
MODULE 5
• IBM Utilities
• System Utility Programs
• DataSet Utility Programs
• Independent Utility Programs

MODULE 6
• Concatenation of Dataset & Rules
• Temporary Dataset
• Referbacks
• Special DD Statements-JOBLIB &STEPLIB Statements
• JCLLIB Statements
Course Outline(Contd)
• Symbolic Parameters
• SET & Special DD names
• INCLUDE Statement

MODULE 7
• Catalogued Procedures
• Instream Procedures
• Modifying Procedures

MODULE 8
• Keyword Parameter=COND
• Commonly Occuring Abend Codes
• IF/THEN/ELSE/ENDIF Statement
• Operators
Course Outline(Contd)
MODULE 9
• Uses of GDG
• Define a GDG
• Delete a GDG

MODULE 10
• JES2 Control Statements
• JES3 Control Statements

MODULE 11
• DFSORT
References
• MVS JCL by Doug Lowe
• IBM Job Control Language Course notes
• MVS JCL Primer by Saba Zamir & Ranade
• www.mvshelp.com
 
MODULE 1
Introduction - Job Control
Language
• Job Control Language is the means of communication between an
application program and the computer's operating system (the IBM
OS 390 MVS Operating System). JCL carries specific orders
through control statements.
• What Can I Do With JCL?
– submit a job to the operating system
– request resources needed to run the job
– control the system’s processing of the job
• What is needed to Write JCL?
– access to the IBM mainframe computer
– a valid TSO user ID
Introduction - Job Control
Language (Contd)
• Functions of JCL
– It identifies your Job to the system.
– It describes the Job’s requirements.
– It directs the execution of the program(s)
– It describes the devices(readers,printers etc.) and
resources(datasets) needed by the program(s).
– JCL statements provide information that the operating system
needs to execute a job
– A job is something that you want to accomplish with the aid of a
mainframes, e.g. copy a data set, execute a program, or process
multiple job steps. You need to supply the information that the
job requires and instruct the computer what to do with this
information. You do this with JCL statements
Basic Terminology and JCL
statement Format
• JCL Statement Format
– Job Control Language (JCL) is very precise. It has specific rules
of grammar and syntax that must be followed. JCL must not
contain any irregularities. The JCL will be rejected if it contains
typographical errors (including extra or missing spaces or
commas), fields in the wrong order, etc. JCL and JES2
statements (except for comments) must not contain lower case
letters.
Basic Terminology and JCL statement
Format(Contd)
• BASIC TYPES OF JCL STATEMENTS
– JOB STATEMENT :Provides accounting information as well as job
name to each job.
– EXEC STATEMENT: calls specified program or procedure for
execution.
– DD STATEMENT:provides details about the various resources used
by the program.
– COMMENT STATEMENT: The comment statement contains
comments. It is used primarily to document a program and its
resource requirements.
– DELIMITER STATEMENT: The delimiter statement signifies the end
of a job step.
– NULL STATEMENT: The null statement signifies the end of a job.
JCL statement Format(Contd)
• JCL Parameter Fields
– Each Job Statement is logically divided into:
• Identifier Field
• Name Field
• Operation Field
• Parameter Field
• Comment Field
Job Control Language Format
Identifier Field
Name Field
(Contd)
Operation Field
Parameter Field

// L110 JOB (00124,'MONTHLY STATISTICS'),


// CLASS=P,MSGCLASS=P,REGION=0M
// LST11008 EXEC PGM=TEST
// LST11018 EXEC LST11018,ENV=IPHP,UNITCT=CART,CTL=IPHP,
// UNITDA=PRODDA
// SYSIN DD *
// SYSPRINT DD SYSOUT=*
Job Control Language
Format(Contd)
• Identifier field
– The identifier field indicates to the system that a statement is a
JCL statement rather than data. The identifier field consists of
the following:
• Columns 1 ,2 and 3 of all JCL,indicates if it is a JCL
statement,delimiter statement or a comment statement
– // indicates it is a JCL statement
– /* indicates it is a JES2 statement or a delimiter
statement
– //* indicates it is a Comment statement
Job Control Language
Format(Contd)
• Name field
– The name field associates a name with the JCL statement so
that the system can refer to it.
– For JCL statements, code the name as follows:
• The name must begin in column 3.
• The name is 1 through 8 alphanumeric or national ($, #, @)
characters.
• The first character must be an alphabetic or national ($, #,
@).
• The name must be followed by at least one blank.
Job Control Language
Format(Contd)
• Operation field
– The operation field specifies the statement function. Code the
operation field as follows:
• The operation field follows the name field.
• The operation field must be preceded and followed by at
least one blank.
• The Operation field is required and begins anywhere in
columns 4 through 15.
Job Control Language
Format(Contd)
• Parameter, or operand field
– The parameter field, also sometimes referred to as the operand field,
contains parameters separated by commas and there should be no
blanks between parameter fields . Code the parameter field as
follows:
• The parameter field follows the operation field.
• The parameter field must be preceded by at least one blank.
– The Operand Field provides details and instructions necessary for
the system to perform the job. It is composed of one or more
parameters, separated by commas.
– There are positional parameters, which appear in a specific order,
and keyword parameters, which are of the form KEYWORD=VALUE.
Job Control Language
Format(Contd)
• Comments field
– The comments field contains any information you deem helpful
when you code the control statement. Code the comments field
as follows:
• The comments field follows the parameter field.
• The comments field must be preceded by at least one blank
and ends in column 71.
• You can code comments after the parameter field even
though you continue the parameter field on a subsequent
statement
Job Control Language (Contd)
• All JCL statements cannot be continued to the next line.They are
– Comment statement
– Delimiter statement
– Null statement
• The comment and parameter fields of other JCL statements can be
continued in the next line.When one continues the comment field to
next line he has to leave the column 72 with a non blank character.
• (check the validity to continue comment statement – anish)
• Code // in columns 1 and 2 of the following statement to be continued.
• Continue the interrupted parameter or field beginning in any column
from 4 through 16.
• //NAME OPERATION PARAMETER,
• // PARAMETER, PARAMETER
Positional vs Keyword Parameters

• Positional Parameters:
– Must be first and in specific order.
– Absence must be indicated by comma.
– If last one is absent no comma necessary.
– If all later ones absent no commas necessary.
– If all positional parameters absent no commas necessary.
• TIME=(5,0) is not necessary TIME=(5) is enough
• TIME=(,30) is same as TIME=(0,30) but TIME=(30) is not
correct.
Positional vs Keyword Parameters
• Keyword Parameters
– Appears after positional parameters.
– Can be in any order with respect to one another.
– Need not indicate the absence of a keyword parameter.
– Below statements are valid
• //NAME OPERATION K1=A,K2=B
• //NAME OPERATION K2=B,K1=A
SAMPLE JCL CODE
//L110 JOB (00124,'MONTHLY STATISTICS'),
// CLASS=P,MSGCLASS=P,REGION=0M
//JOBLIB DD DSN=IPHP.DUMMY,DISP=SHR
// DD DSN=IPHP.BT.PGMLIB,DISP=SHR
// DD DSN=IPHP.OL.PGMLIB,DISP=SHR
// DD DSN=IMSS.RESLIB,DISP=SHR
//LST11008 EXEC
LST11008,ENV=IPHP,UNITDA=PRODDA,CTL=IPHP
//LST11018 EXEC LST11018,ENV=IPHP,UNITCT=CART,CTL=IPHP,
// UNITDA=PRODDA
//LST11020 EXEC LST11020,ENV=IPHP,UNITCT=3490,
// UNITDA=PRODDA
MODULE 2
JOB statement
• The Job statement names a job, supplies accounting and billing
information, and supplies options to control processing of the
job.
• The JOB statement is always your first JCL statement. It
signals the beginning of a job and the end of any previous job
and assigns a name to your job.
//L116 JOB (00124,‘PROGRAMMER NAME'),
// CLASS=J,MSGCLASS=Z,REGION=0M,MSGLEVEL=(0,0),
// NOTIFY=&SYSID,TIME=(2,30),TYPRUN=SCAN,RESTART=STEP2
• The JOB card requires
the Jobname, which appears on the header page of your
output,
the word JOB in the Operation field,
the accounting information for your job,
the programmer's name.
Positional Parameters in JOB statement -
Accounting & Programmer

• Accounting Information on the JOB card


– (pano,room,time,lines,cards,forms,copies,log,linect)
• Pano indicates the programmers account number, room indicates
programmers room number, time indicates an estimate of job’s
execution time in minutes etc..
– Code a comma in place of each omitted sub parameter when other
sub parameters follow.
– May or may not be required depending on the installation.

• Programmer Name
– The PROGRAMMER name can be a maximum of 20 characters.
Keyword Parameters in JOB statement –
CLASS,MSGCLASS,MSGLEVEL

• The CLASS Parameter


– The CLASS parameter is used to assign your job to a job processing
class. The CLASS parameter specifies the class in which the job will be
run and it depends on the characteristics of Job.
– CLASS=n where n varies from A-Z or from 0-9.
– If one does not specify the CLASS parameter the installation
establishes a default CLASS.
– Three resources are the controlling factors in determining the class to
be system assigned:
• 1) REGION size 2) TAPE DRIVE QUANTITY 3) CPU time specified
for JOB execution
• REGION size is controlled by the 'REGION=' parameter on the JOB
or EXEC statement.
• The quantity of CPU time is specified with the 'TIME=' parameter on
the JOB card as defined in the JCL manual.
MSGCLASS
• The MSGCLASS Parameter
– The MSGCLASS parameter assigns the job log for a job to a
particular sysout output class.MSGCLASS specifies the default
print class for all output data sets generated by the job.
– MSGCLASS = n, where n is any value from A – Z or from 0 – 9.
If omitted, the default MSGCLASS=A (Printer) is set by the
installation. The job log contains the JOB statement, the JCL for
the job, JCL processing messages, in-stream and cataloged
procedure statements, and JES2 messages and MVS operator
messages, if any.
MSGLEVEL
• The MSGLEVEL Parameter
– The MSGLEVEL parameter is used to control the amount of
system messages generated for a Job.The following job log
elements can be controlled:
• The JOB statement.
• All JCL in the job's input stream including all JCL statements
and JES2 control (JECL) statements.
• In-stream and cataloged procedure statements for a
procedure invoked by a job step.
• JCL substitution and processing messages.
MSGLEVEL(Contd)
• Values for 'statements' in the MSGLEVEL keyword can be one of
these:
– 0 – Print only JOB statements
– 1 – Print all JCL and JES statements & messages
– 2 – Print only JCL & JES statements
• Values for 'messages' in the MSGLEVEL keyword can be one of
these:
– 0 – Prints only JCL messages if the job ABENDs and JES
messages also
– 1 – Prints JCL and JES messages
– The default value supplied if MSGLEVEL is omitted is (1,1).
MSGLEVEL(Contd)
– JES and MVS operator messages concerning the job's
processing, including those for allocations of devices/volumes,
start/stop of job steps and the job, and the disposition of the data
sets used.
• Syntax: MSGLEVEL=({statements},{allocation messages})
• Examples:
– Print minimal job log:
• // MSGLEVEL=(0,0)
– Print everything in job log :
• // MSGLEVEL=(1,1)
NOTIFY
• NOTIFY:
– This parameter notifies TSO session of the completion of a job.
The message to the TSO terminal indicates whether the job was
cancelled or ABENDed.
– On your JCL JOB card, use the NOTIFY parameter as follows:
• //jobname JOB (accounting info,'description',)
// NOTIFY=userid where userid is 1 through 7 alphanumeric
characters and must be valid one.
– NOTE: If you are logged on at the time the job completes, the
message will appear immediately. If not, the message will
appear the next time you begin a TSO session.
TIME
• TIME
– The TIME parameter specifies the maximum CPU time allocated
for a job. If a job uses less than the amount specified, then the
account is billed only for the time used. If a job tries to use more
time than the maximum specified, the job will terminate with an
S322 ABEND. The TIME parameter has two positional
subparameters, minute and second.
• TIME=(min,sec) or TIME=min or TIME=(,sec)
• The time parameter on the job card does not override the
step parameter. (Warning : If you put a time parameter on
steps in your job and also a time parameter on the job card,
the time parameter on the job card must be larger than the
combined step parameters or the job will abend.)
TIME (Contd)
• TIME=NOLIMIT or TIME=1440 – Indicates that the Job can use the
processor for the unlimited period of time.( ie : 24 hrs)
• TIME=MAXIMUM – Indicates that the Job can use the processor for
the maximum amount of time ie: 357912 mins.(248.55 days)
REGION
• REGION:
– The REGION parameter specifies the amount of computer
memory allocated for your job. If the REGION parameter is
omitted, the system uses a default region size set by the
installation.
– Region=0M and default value
RESTART
• RESTART :
– It specifies the new starting step for a Job.
• RESTART=STEP2 – starts from the STEP2
• RESTART=Procname.Stepname – starts from the a step
within a cataloged procedure
• RESTART=* - starts from the first step.
Note: Datasets created in or after restarted step of previous run may
still exist and should be deleted first.
TYPRUN
• TYPRUN : It tells the system either to check the JCL or hold it for
later execution.
• It has four options –
– TYRUN=COPY – requests the Job to be printed as a sysout
dataset but not to be processed
– TYPRUN=HOLD – requests the Job to be released by the
operator before it will be processed.The JCL will be checked
before HOLD.
– TYPRUN=JCLHOLD – requests to hold the Job before
completing JCL processing.
– TYPRUN=SCAN – requests the system to scan the JCL for
syntax errors.
Exercises
1.Identify the following as valid or invalid examples of job names.
If invalid,why?
1.//JOB13
2.//RUN#2
3.//*RUN#5
4.//$ABCD
5.//TEST#4675
6.//1@PAY011
Exercises(Contd)
2.Use the following information and code a job statement
JOBNAME - ABC1
ACCOUNT# - D4123
PGM.NAME - YOUNG
MESSAGE CLASS -E
PRINT ALL JCL STATEMENTS
PRINT ALL MESSAGES
Exercises(Contd)
3.Use the following information and code a job statement
JOBNAME - ABC2
ACCOUNT# - 123-34
PGM.NAME - SMITH
MESSAGE CLASS -C
PRINT ONLY JOB STATEMENT
NO MESSAGES
Exercises(Contd)
4.Use the following information and code a job statement
JOBNAME - ABC3
ACCOUNT# - 4123
PGM.NAME - TIGER
MESSAGE CLASS -D
NOTIFY - ABC
PRINT ALL JCL STATEMENTS
NO MESSAGES
Exercises(Contd)
5.Use the following information and code a job statement
JOBNAME - ABC4
ACCOUNT# - 4123,25
PGM.NAME - YOUR NAME
MESSAGE CLASS -E
NOTIFY - ABC
EXECUTION CLASS -A
MODULE 3
EXEC Statements
• EXEC Statement:
– EXEC (execute) statement to names the program to be
executed or invokes cataloged or in-stream procedure that the
job is to execute
– The EXEC statement marks the beginning of each step in a job
or a procedure.
– A job can have a maximum of 255 job steps.
• Syntax
• //LST1108 EXEC LST1108
• //LST1109 EXEC PGM=PGM1
EXEC Statements (Contd..)
Identifier
Name Field
Operation
Parameter Field
Comment field
//JOBNAME JOB (‘KINWN’,TIME=(0,5)…….. (72-80)

//STEPNAME EXEC PGM=TEST1

//STEPNAME EXEC PROC


 
Col 3
Col 1
EXEC Statement (Contd)
• Name field:
– It must be unique within the job.
– The stepname must begin in column 3.
– It can contain max of 8 alphanumeric or national characters
– The first character must be a alphabet.

• Operation Field:
– This field consists of characters EXEC and can start in any
column.
– The word EXEC must be preceded and followed by a blank.
EXEC Statement (Contd)
• Comment field:
– The comments field follows the parameter field after at least one
intervening blank.
• Parameter field:
– EXEC statement has 2 types of parameter fields.
• Positional Parameter Field
• Keyword Parameter Field.
Positional Parameters
• The two positional parameter of EXEC statements are:
– PGM
• It refers to a program name or a procstepname.
• The program name must be 8 characters long.
– PROC or Procedure name
• It refers to procedure name.
Positional Parameters (Contd)
• PGM parameter:
– It is used to name the program that the system is to execute.
– Coded as first parameter in EXEC statement.
– The specified program must be a load member of a partitioned
data set (PDS) used as a system library, a private library, or a
temporary library.
– PGM=program-name
• Program name specifies the member name or the alias of the
program to be executed.
Positional Parameters(Contd)

– These statements indicate that the system is to


search the private library DEPT12.LIB4 for the
member named USCAN, read the member into
storage, and execute the member.

//JOB8 JOB BOB,MSGLEVEL=(2,)


//JOBLIB DD DSNAME=DEPT12.LIB4,DISP=(OLD,PASS)
//STEP1 EXEC PGM=USCAN
Positional Parameters(Contd)
• PROC parameter
– It is used to specify that the system is to call and execute a
cataloged or in-stream procedure.
– Syntax
{PROC=procedure-name} or {procedure-name}
• procedure-name Identifies the procedure to be called and
executed:
• The member name or alias of a cataloged procedure.
• The name on the PROC statement that begins an in-stream
procedure. The in-stream procedure must appear earlier in
this job.
Positional Parameters(Contd)
– This statement EXECutes the cataloged or in-stream procedure
named OPERATE.
• //BK EXEC OPERATE
– This statement EXECutes the cataloged or in-stream procedure
named PAYWKRS.
• //SP3 EXEC PROC=PAYWKRS
Keywords Parameters(Contd)
• Region
– This parameter is used to specify the amount of central or virtual
storage that the steps requires(inclusive of the storage for all the
programs in the step to be executed.)
• Syntax:
– REGION [.procstepname ]={valueK}
{valueM}
– valueK Specifies the required storage in kilobytes
– valueM Specifies the required storage in megabytes
– A JOB statement REGION parameter applies to all steps of the
job and overrides any EXEC statement REGION parameters.
Keywords Parameters(Contd)
• Example
– The system assigns 40K bytes of central (real) storage to this
job step.
//MKBOYLE EXEC PROC=A,ADDRSPC=REAL,REGION=40K
//STP6 EXEC PGM=CONT,REGION=120K
– The system assigns a region of 120K bytes. When the
ADDRSPC parameter is not specified, the system defaults to
ADDRSPC=VIRT.
Keywords Parameters(Contd)
• ADDRSPC –(Address Space) Indicates the type of storage for the
present step.
– This parameter cannot override the specific type of storage coded in
the job statement but can override the system default.
– Syntax=ADDRSPC[procstepname]={VIRT/REAL}
• VIRT - requests virtual storage.The system can page the job step.
• REAL - requests real storage.The system cannot page the job
step and must place the job step in central storage.
• The system uses the EXEC statement ADDRSPC parameter only
when no ADDRSPC parameter is on the job statement.
– Example
• //CAC1 EXEC PGM=A,ADDRSPC=VIRT
• //CAC2 EXEC PROC=B,ADDRSPC=REAL,REGION=8K
Keywords Parameters(Contd)
• TIME parameter
– It is used to specify the maximum amount of time that a job step
may use the processor or to find out through messages how
much processor time a step used.
– You can use the TIME parameter on an EXEC statement to
increase or decrease the amount of processor time available to
a job step over the default value.
– TIME [.procstepname ]= {([minutes ][,seconds ])}
{1440 }
{NOLIMIT }
{MAXIMUM }
{}
– Minutes : Specifies the maximum number of minutes the step
can use the processor. The minutes must be a number from 0
through 357912 (248.55 days).
Keywords Parameters(Contd)
– Seconds :Specifies the maximum number of seconds that the
step can use the processor, in addition to any minutes that are
specified. The seconds.
– NOLIMIT: Indicates that the step can use the processor for an
unlimited amount of time.
– 1440: Indicates that the step can use the processor for an
unlimited amount of time.
– MAXIMUM : Indicates that the step can use the processor for the
maximum amount of time.
• Coding TIME=MAXIMUM allows the step to run for 357912
minutes.
Keywords Parameters(Contd)
• This statement specifies that the maximum amount of time the step can
use the processor is 12 minutes, 10 seconds.
– //STEP1 EXEC PGM=GRYS,TIME=(12,1 )
• This statement specifies that the maximum amount of time the step can
use the processor is 30 seconds.
– //FOUR EXEC PGM=JPLUS,TIME=(,3 )
• This statement specifies that the maximum amount of time the step can
use the processor is 5 minutes.
– //INT EXEC PGM=CALC,TIME=5
• This statement specifies that the step can have unlimited use of the
processor. Therefore, the step can use the processor and can remain in
a wait state for an unspecified period of time, if not restricted by the JOB
statement TIME parameter.
– //LONG EXEC PGM=INVANL,TIME=NOLIMIT
PARM Parameter
• PARM :
– Passes control information to the job step when the step is
initiated.
– This is useful for passing runtime information to an application
program
– Syntax = PARM[procstepname]= information.
– Information can be of 100 characters.
//STEP1 EXEC PGM=IEFBR14,PARM=(19980316,
// 19980322)
//STEP2 EXEC PGM=IEFBR14,PARM=('START=03/18/98',
// 'STOP=03/22/98')
PARM Parameter (Contd)
• PARM parameter
– It is used to pass variable information to the processing program
executed by this job step.
– Syntax
• PARM [.procstepname ]=subparameter
• PARM [.procstepname ]=(subparameter,subparameter)
• Subparameter: Consists of the information to be passed to
the processing program.
– The length of the subparameters passed must not exceed 100
characters inclusive of commas passed to the processing
program.
PARM Parameter (Contd)
– The system passes P1,123,P2=5 to the processing program
named APG22.
• //RUN3 EXEC PGM=APG22,PARM='P1,123,P2=5‘

– The system passes MT5 to the first step of the procedure named
PROC81. If PROC81 contains more steps and their EXEC
statements contain PARM parameters, the system nullifies those
PARM parameters.
• //EXEC PROC=PROC81,PARM=MT5
Exercises
1.What is the error in the following JCL statements
i)//step#three exec pgm=hkbc762
ii)//step#3 exec pgm=hkbc762
iii)//step#3 exec pgrm=hkbc762

2.What is the difference between the following statements


i)//step1 exec pgm=accpay
ii)//step1 exec accpay
MODULE 4
DD Statement
• DD (data definition)
– This statement is used to convey information about the data that will be
read or written within Job.
– Syntax:
//ELECSTD DD
// DSN=PSET.CDRS.SAS.CDRS341.ELECSTD.FLATFILE,
// DISP=SHR
– The DD statement consists of the characters // in columns 1 and 2 and
four fields: name,operation (DD), parameter, and comments.
– A DD statement is required for each data set.
– Each ddname should be unique within the job step.
– The ddname is 1 through 8 alphanumeric or national ($, #, @)
characters.
– The first character must be alphabetic or national ($, #, @).
– The ddname must be followed by at least one blank.
DD Statement (Contd)
• Name field:
– Each ddname should be unique within the job step.
• Operation Field:
– The operation field consists of the characters DD and must be
preceded and followed by at least one blank. It can begin in any
column.
• Comments Field:
– The comments field follows the parameter field after at least one
intervening blank.
• Parameter Field:
– A DD statement has two kinds of parameters: positional and
keyword.
Positional Parameters on DD
Statement
• “ * “ specifies that data follows immediately; no keyword parameters
may follow. The data may not contain any records beginning with //
or /*.
– A cataloged or in-stream procedure cannot contain a DD *
statement.
– You can code more than one DD * or DD DATA statement in a
job step in order to include several distinct groups of data for the
processing program. Precede each group with a DD * or DD
DATA statement and follow each group with a delimiter
statement.
Positional Parameters on DD
Statement (Contd)
• DATA :
– It specifies that data follows immediately; keyword parameters
may follow the DATA positional parameter. The data may
contain records beginning with //, but none beginning with /*.
• DUMMY :
– It specifies that if the file is an output file, the output is to be
discarded. If the file is an input file,it specifies that there is no
data.
• Example
//MYDS DD DSNAME=REPORT
//A DD DSNAME=FILE
Keyword Parameters on DD
Statement
• DSNAME:Specifies the name of a data set.
– Unqualified Name :1 through 8 alphanumeric or national ($, #,
@) characters, a hyphen, or a character X C0 . The first
character must be alphabetic or national ($, #, @).
– Qualified Name: Multiple unqualified names joined by periods.
• The maximum length of a qualified data set name is 44 characters,
including periods.
• Data Set Name for Temporary Data Set
• A temporary data set is a data set that you create and delete within
a job.When you use DSNAME for a temporary data set, code the
name as two ampersands (&&) followed by a character string 1 to 8
characters in length
– &&dsname Specifies the name of a temporary data set.
Keyword Parameters on DD
Statement (Contd)

• Data Set Name for Dummy Data Set :


– NULLFILE
– Specifies a dummy data set. NULLFILE has the same effect as
coding the DD DUMMY parameter. NULLFILE must be coded as
a single-word parameter.
Keyword Parameters on DD
Statement t (Contd)
• //DD1 DD DSNAME=ALPHA,DISP=(,KEEP),
//UNIT=342 ,VOLUME=SER=389984
– DD statement DD1 defines a new data set and names it ALPHA.
DD statements in later job steps or jobs may retrieve this data
set by specifying ALPHA in the DSNAME parameter, unit
information in the UNIT parameter, and volume information in
the VOLUME parameter.

• //DDSMS1 DD DSNAME=ALPHA.PGM,
//DISP=(NEW,KEEP),DATACLAS=DCLAS1,
//MGMTCLAS=MCLAS1,STORCLAS=SCLAS1
– DD statement DDSMS1 defines a new SMS-managed data set
and names it ALPHA.PGM. DD statements in later job steps or
jobs may retrieve this data set by specifying ALPHA.PGM in the
DSNAME parameter.
Keyword Parameters on DD
Statement (Contd)
• DISP :
– Used to instruct the system as to the current status of a data set
– It also indicates the steps to be taken with the dataset upon
successful or unsuccessful execution of a Job
– Syntax DISP=(status,normal-disposition,abnormal-disposition)
• status - indicates current status of dataset
– NEW – the dataset does not exist and should be created
– OLD – the dataset exists and should be allocated for
exclusive use
– SHR – the dataset exists and should be allocated for shared
use
– MOD – the dataset is allocated for exclusive use and is
positioned at the end of the data, so additional records may
be added after last record
Keyword Parameters on DD
Statement (Contd)
• normal-disposition – specifies how the dataset is to disposed upon
normal execution of job
– DELETE – the dataset is deleted . If the dataset was retrieved
from catalog, it is also uncataloged
– KEEP – the dataset is retained
– CATLG – the dataset is retained and catalog entry is made
– UNCATLG – the dataset is retained but it’s catalog entry remove
– PASS – Normal disposition only. The dataset is retained for use
by a later job step
• abnormal-disposition – specifies how the dataset is to be disposed
upon abnormal execution of job
– DELETE – the dataset is deleted . If the dataset was retrieved
from catalog, it is also uncataloged
– KEEP – the dataset is retained
– CATLG – the dataset is retained and catalog entry is made
– UNCATLG – the dataset is retained but it’s catalog entry remove
Keyword Parameters on DD
Statement (Contd)
– MVS assumes default values for DISP parameter
• If status subparameter is omitted MVS assumes it as NEW
• If normal-disposition subparameter is omitted the default
depends on the status subparameter
– If status subparameter is NEW the normal disposition
subparameter is DELETE else KEEP
• If abnormal disposition subparameter is omitted it takes
whatever value specified in normal disposition subparameter
– DISP=SHR – Allocates an existing dataset for shared access,
normal and abnormal disposition parameter default is KEEP
Keyword Parameters on DD
Statement (Contd)
– DISP=OLD – allocates an existing dataset for exclusive access,
normal and abnormal disposition default set to KEEP
– DISP=MOD – if dataset exists, extend it else create it. The
access is exclusive, normal and abnormal disposition default is
set to KEEP
– DISP=(NEW,CATLG) – allocates a new dataset and catalogs it,
abnormal disposition set to CATLG
– DISP=(OLD,DELETE) – allocates and exiting dataset and
deletes it , abnormal disposition set to DELETE
– DISP=(,KEEP,DELETE) – allocates a new dataset and keeps it if
job step ends normally, if job step ends abnormally the dataset is
deleted
– DISP=(NEW,CATLG,DELETE) – the dataset is created,
cataloged if the job step ends normally and deletes it if job step
ends abnormally
Keyword Parameters on DD
Statement (Contd)
• DCB Parameter:describes the dataset.
– //DD1A DD
DSNAME=EVER,DISP=(NEW,KEEP),UNIT=3380,
– //
DCB=(RECFM=FB,LRECL=326,BLKSIZE=23472),
– // SPACE=(23472,(2 ,4 ))
• DD statement DD1A defines a new data set named EVER on a
3380. The DCB parameter contains the information necessary to
complete the data control block.
Keyword Parameters on DD
Statement (Contd)
• Important subparameters of DCB parameter:
• BLKSIZE : specifies the number of bytes (characters) per
block,where b is a multiple of the LRECL.
• LRECL : specifies the logical record length (n) for fixed or variable
length records; omit LRECL for records of undefined length.
Keyword Parameters on DD
Statement (Contd)
• RECFM : specifies the record format. Common values for RECFM
are
– U for undefined-length records,
– V or VB for variable-length or variable-blocked records,
– F or FB for fixed-length or fixed-blocked records, and
– FA, FBA, or VBA for fixed, fixed-blocked, or variable-blocked
records with a printer control character as the first byte of data.
Keyword Parameters on DD
Statement (Contd)

• UNIT :
– It specifies whether the dataset is to reside on disk or tape; device can be
DISK for disk datasets, TAPE for cartridge tape datasets, or REEL for
reel (round) tape datasets.
• UNIT= [device_address]
– Each I/O device is assigned a hardware address when a system is
generated
– Device address is expressed as a three/four hexadecimal digits
• //JOB1 JOB A123,’NAME’
• //STEP1 EXEC PGM=PGM1
• //DATA1 DD DSN=FILE1,
• // UNIT=S04
– Here when the Job is executed PGM1 is executed and a dataset
called FILE1 which resides on a device identified by its hardware
address S04 is accessed
Keyword Parameters on DD
Statement (Contd)
• UNIT= [device_type]
– Device type is identified by the model number assigned to that device
by IBM.
– It is installation specific
• //JOB2 JOB A124,’NAME’
• //STEP1 EXEC PGM2
• //DATA1 DD DSN=FILE2,
• // UNIT=3390
– Here when the JOB2 is submitted PGM2 is executed and a
dataset called FILE2 which resides on a 3390 disk unit is
accessed
Keyword Parameters on DD
Statement (Contd)
• UNIT=[device_group_name]
– Device group name is symbolic name which is assigned to a
group of devices when system is generated
– Devices are grouped together based on their functions
• //JOB3 JOB A125,’NAME’
• //STEP2 EXEC PGM=PGM3
• //DATA2 DD DSN=FILE3,
• // UNIT=TESTDA
– Here when JOB3 is submitted PGM3 is executed which
accesses FILE3. The file can reside on any of devices
which are grouped under symbolic name TESTD
Keyword Parameters on DD
Statement (Contd)
• UNIT=[device,DEFER]
– It defers the mounting of volume that UNIT references, until
dataset that resides on it is opened
• //JOB4 JOB S123,’NAME5’
• //STEP2 EXEC=PGM4
• //NAME DD DSN=DATA3,
• // UNIT=(TAPE,DEFER)
– Here when JOB4 is submitted, PGM4 is executed. The
dataset UNIT parameter along with DEFER
subparameter is used to specify that dataset resides on
TAPE and tape need not be mounted until system
specifically requests it.
Keyword Parameters on DD
Statement (Contd)
• UNIT=[AFF=ddname]
– AFF subparameter is used to reference a device that specified in
a prior DD statement
– AFF stands for affinity
– Advantage is AFF subparameter forces datasets into same
device and thus saving storage space on available I/O devices
• //JOB1 JOB D13,KIRAN
• //STEP1 EXEC PGM=PGM1
• //NAME1 DD DSN=DATA1
• // UNIT=CART
• //NAME2 DD DSN=DATA2
• // UNIT=AFF=NAME1
– Here the datasets NAME1 & NAME2 resides in the same
unit.
Keyword Parameters on DD
Statement (Contd)
• VOL parameter
– Specifies the volume on which the dataset resides; name is either a disk
pack or a tape name.
– This parameter can be omitted for an existing catalogued data set.
• VOL=SER
– This is used to request specific volumes
• //JOB1 JOB D12,’GIREESH’
• //STEP1 EXEC PGM=PGM1
• //NAME1 DD DSN=DATA1,
• // VOL=SER=23456
• VOL=REF subparameter
– This is used to specify a volume which has been previously defined
within same Job, but not in current step
– VOL=REF=*referback
Keyword Parameters on DD
Statement (Contd)
//JOB1 JOB C123,’JANNET’
//STEP1 EXEC PGM=PGM1
//DD1 DD DSN=DATA1,
// VOL=SER=VOL1
//DD2 DD DSN=DATA2,
// VOL=REF=*.STEP1.DD1
Here when the Job is submitted the program PGM1 is
executed the dataset DD1 is accessed from volume
whose serial number is VOL1. The reference is again
made to same volume number in DD2 via the Reference
sub parameter.
Keyword Parameters on DD
Statement (Contd)
• Space parameter:
– Used to specify the storage requirements on direct access devices
– Syntax SPACE= (CYL,(primary,secondary,directory),RLSE)
= (TRK,(primary,secondary,directory),RLSE)
= (BLK,(primary,secondary,directory),RLSE)
– primary – specifies how many units of space to allocate for the
dataset’s primary extents.
– secondary – if the file requires space more than what is allocated in
primary extent, secondary extents can be used to allocate upto 15
times.
– directory – this is used only for partitioned datasets
• this is used to record the names and locations of members
created within partitioned datasets
• It should be a number that specifies how many 256-byte blocks
are to be contained in the directory of a PDS
Keyword Parameters on DD
Statement (Contd)

• RLSE –
– It specifies that any unused space is to be released when the job
step is finished with the data set.
• This parameter is optional; it should be coded for sequential
data sets only.
• Example
– SPACE=(TRK,(20,5),RLSE)
– The maximum space that could be allocated is: 20 + 5(15) = 95
tracks.
Exercises
1.Write a DD statement for creating a new dataset with the following
features
1.The dataset should be deleted once the step completes
2.The dataset should be deleted once the step abends
3.It should be sequential dataset with primary and
secondary allocation of 2 blocks each.
4.The unused space should be freed once the step finishes
5.The logical record length be 80,block size of 800
and record format as FB
Exercises(Contd)
2.Write a DD statement for creating a new dataset with the following
features
1.The dataset is to be kept at the end of step
2.The dataset is a partitioned dataset and it is to reside on the tape
3.Specify a primary allocation of 10 blocks and secondary allocation
of 5 blocks
MODULE 5
IBM UTILITIES
• What is a Utility?
– A set of used and tested programs that perform a variety of useful
functions.
– Assist in organizing and maintaining data.
– Examples of uses of Utility Programs:
• Copy files from one storage medium to another (e.g. card to
disk, tape to print).
• Back up and restore disk-packs.
• Catalog, scratch or rename files.
• Copy and compress partitioned data sets and so on.
• Utility programs are controlled by two types of statements
– JCL statements
– UTILITY statements
IBM UTILITIES (Contd.)
• Each Utility program falls into one of the three classes
– System Utility Programs
– Data set Utility Programs
– Independent Utility Programs
• The selection of a specific utility program is dependent on the nature
of the job to be performed.
System Utility Programs
• System Utility Programs
– Used to maintain and manipulate system and user data
– Maintain libraries and catalog entries
– Initiate volumes
– Volume and data set backup
– List VTOC, directories and catalog.
• Examples :
– A System Utility Program can be used to rename a data set.
– It can also be used to move or copy collections of data.
System Utility Programs(Contd.)
• System Utility Programs (starts with IEH)
– IEHATLAS
– IEHINITT
– IEHLIST
– IEHMOVE
– IEHPROGM
– IEHSTATR
Dataset Utility Programs
• Data set Utility Programs
– Used to reorganize, change or compare data (data set or record level)
– Allows to manipulate PDS/ SEQ data sets (fields within a logical record
to entire data sets)
– Controlled by JCL and utility statements
– The programs are executed as jobs
• Examples:
– Data set Utility Programs can be used to compare records in
sequential or partitioned data sets.
– They can also be used to copy, compress or merge partitioned data
sets.
Dataset Utility Programs(Contd.)
• Data set Utility Programs (starts with IEB)
– IEBCOMPR
– IEBCOPY
– IEBDG
– IEBEDIT
– IEBGENER
– IEBIMAGE
– IEBISAM
– IEBPTPCH
– IEBUPDTE
Dataset Utility
Programs(Contd.)
• IDCAMS UTILITY
– IDCAMS, also known as Access Method Services, is used to
perform the following tasks:
• Create a VSAM data set, VSAM alternate index, or catalog
• List a catalog entry for a data set, file/catalog contents
• Copy a file or catalog
• Print all or part of a data set in character or hex format
• Build a backup copy of a VSAM data set, catalog, non-VSAM
data set, or an alternate index
• Convert non-VSAM to VSAM data set, VSAM to SAM format,
CVOLs to ICF catalogs, VSAM catalog entries to ICF catalog
entries
• Alter the attributes of a catalog or data set
• Catalog or Uncatalog VSAM/non-VSAM data set and GDGs
Dataset Utility
Programs(Contd.)
• Verify a VSAM data set's software end-of-file indicator.
• Delete a VSAM or non-VSAM data set or volume records,
catalog, path, GDG, alias, candidate volume, alternate index,
page space, or truename catalog entry
• Attach a user catalog to the master catalog
• Create a MVS paging space, generation data group (GDG)
• Collect data set and volume info. on migration utility
• Connect catalogs to one another
• Import/Export VSAM data sets, catalogs
• Load a VSAM file from SAM, ISAM, or VSAM records
• Unload a VSAM data set
• Merge ICF catalogs or recreate ICF entries
• Rename VSAM data sets
• Move a catalog and VSAM/non-VSAM data sets
Dataset Utility Programs
(Contd.)
• Sample IDCAMS JCL:
//JS10 EXEC PGM=IDCAMS,REGION=1024K,PARM=parameters

//STEPCAT DD DSN=...,DISP=SHR Optional STEPCAT


//anyname DD DSN=... Optional file
//SYSPRINT DD SYSOUT=* IDCAMS Messages file
//SYSIN DD * Control Statements file
control statements...
/*
Dataset Utility Programs
(Contd.)
• IEBGENER Utility
– IEBGENER is a generalized copy utility used to perform the
following tasks:
• Produce a backup copy of a sequential data set, or a member of
a PDS or PDSE.
• Produce a PDS or PDSE, or a member of either, from a
sequential file.
• produce an "edited" sequential data set, PDS, PDSE, or a
member in either
• Handle double-byte character set data DBCS data
• Produce printed list of either sequential data sets or PDS/PDSE
members
• Reblock a data set or change its logical record length
• Provide exit or editing capabilities for label processing, input
data editing, key creation, or permanent I/O error processing.
Dataset Utility
Programs(Contd.)
• Sample IEBGENER JCL:
//JS10 EXEC PGM=IEBGENER,REGION=1024K

//SYSPRINT DD SYSOUT=* Messages


//SYSUT1 DD DSN=...,DISP=... Sequential Input File

//SYSUT2 DD DSN=...,DISP=... Output File


//SYSIN DD * Control Statements

control statements...
/*
Dataset Utility
Programs(Contd.)
• Sample JCL to copy one file to another file:
//JS10 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MY.DSN.IN,
// DISP=SHR
//SYSUT2 DD DSN=MY.DSN.OUT,
// DISP=(,CATLG),
// VOL=SER=volser,
// SPACE=(TRK,(30,30),RLSE)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*
Dataset Utility
Programs(Contd.)
• IEBCOPY:
– IEBCOPY is a generalized copy utility used to perform the following
tasks:
• IEBCOPY is used to copy all or part of a Partitioned Data Set (PDS)
or PDSE. Selected members of a PDS or PDSE can be copied to
another or the same PDS or PDSE and/or renamed.
• A sequential backup copy of a PDS or PDSE can be made. A PDS
or PDSE can be refreshed from a sequential copy previously
created by an unload. You can load a PDS to an SMS managed
PDSE. Copying a PDSE to a PDS can be done, but application
information stored in the directory of the PDSE will be lost. Altering
RLD counts for load modules in place can also be done
• Is used to "compress" a PDS when all of its unused internal space
has been exhausted. The compress operation reorganizes a PDS
so that all previously unused space inside the PDS is reclaimed. .
Dataset Utility
Programs(Contd.)
• Sample IEBCOPY JCL:
//JS10 EXEC PGM=IEBCOPY,REGION=1024K,
// PARM='SIZE=nnnnnnnnK' Optional PARM
//SYSPRINT DD SYSOUT=* IEBCOPY Messages
//ddname1 DD DSN=...,DISP=... Input File

//ddname2 DD DSN=...,DISP=... Output File

//SYSUT3 DD UNIT=SYSDA,SPACE=(TRK,(30,30),RLSE) Work file 1

//SYSUT4 DD UNIT=SYSDA,SPACE=(TRK,(30,30),RLSE) Work file 2

//SYSIN DD * Control Statements


control statements...
/*
Dataset Utility
Programs(Contd.)
• Sample JCL to compress a PDS:
//JS10 EXEC PGM=IEBCOPY,REGION=1M

//SYSPRINT DD SYSOUT=*
//I1 DD DSN=my.pds, same PDS for I1 & O1
// DISP=OLD
//*
//O1 DD DSN=my.pds,
// DISP=OLD
//SYSIN DD *

COMP1 C O=O1,I=((I1,R))
Dataset Utility
Programs(Contd.)
• Sample JCL to unload a PDS to a tape:
//STEP1 EXEC PGM=IEBCOPY,REGION=1024K

//SYSPRINT DD SYSOUT=*
//I1 DD DSN=my.pds, PDS to unload
// DISP=OLD
//*
//O1 DD DSN=my.pds.tape.copy, tape to unload PDS to
// DISP=(,CATLG),
// UNIT=TAPE,
// VOL=SER=
//SYSIN DD *
COPY1 C O=O1,I=((I1,R))
Dataset Utility
Programs(Contd.)
• Sample JCL to copy 4 members from one PDS to another:
//PDSCOPY EXEC PGM=IEBCOPY,REGION=1024K
//SYSPRINT DD SYSOUT=*
//I1 DD DSN=my.pds.input, copy from here
// DISP=SHR
//*
//O1 DD DSN=my.pds.output, to here
// DISP=SHR
//SYSIN DD *
COPY1 C O=O1,I=((I1,R))
SELC1 S M=MEMBER1,MEMBER2
SELC2 S M=((MEMBER3,NEWMEM3),MEMBER4) rename MEMBER3 to
NEWMEM3
Dataset Utility
Programs(Contd.)
• IEBCOMPR :
• IEBCOMPR is a data set utility used to compare two sequential
data sets, two partitioned data sets or two PDSEs at the logical
record level to verify a backup copy.
• Fixed, variable, or undefined records from blocked or unblocked
data sets or members can also be compared.
• Should not use IEBCOMPR to compare load modules.
• Two sequential data sets are considered equal, that is, are
considered to be identical, if:
– The data sets contain the same number of records.
– Corresponding records and keys are identical .
Dataset Utility
Programs(Contd.)
• Two partitioned data sets or two PDSEs are considered equal if:
– Corresponding members contain the same number of records
– Note lists are in the same position within corresponding
members
– Corresponding records and keys are identical
– Corresponding directory user data fields are identical
Dataset Utility
Programs(Contd.)
• Sample JCL to compare Two Partitioned Data Sets
//DISKDISK JOB ...
//STEP1 EXEC PGM=IEBCOMPR
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD DSNAME=PDSSET1,UNIT=disk,DISP=SHR,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=2000),
// VOLUME=SER=111112
//SYSUT2 DD DSNAME=PDSSET2,UNIT=disk,DISP=SHR,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=2000),
// VOLUME=SER=111113
//SYSIN DD *
COMPARE TYPORG=PO
/*
Independent Utility
Programs(Contd.)
• Independent Utility Program
– Used when the operating system is not available
– Load the universal character set buffer and the forms control buffer for a
printer
– Controlled only by the utility statements
– The programs are not invoked by calling a program
• Examples:
– Independent Utility Program can be used to initialize a direct access
volume and to assign alternate tracks.
– They can also be used to dump and restore the data contents of a direct-
access volume
• Independent Utility Program (starts with ICA)
– ICAPRTBL
Independent Utility
Programs(Contd)
Utility Control Statement Coding Rules

//STEPNAME EXEC PGM=IEHLIST


//SYSIN DD *
(COL.4) (COL.72)

LISTVTOC DSNAME=dsname, x
VOL=device=serial, FORMAT

(COL.16)
UTILITIES (Contd.)
• Utility Control Statement Coding Rules
– Utility Control Statement do not start with a //
– Must be coded in columns 4 through 71
– If the statement exceeds col.71, then use the continuation rules
– Continuation rules
– Break the statement at a comma
– Code a nonblank character in col.72
– Continue the statement in col.16 of the following line
– The utility control statement is coded right after the //SYSIN DD
statement.
//SYSIN DD *
( the word DATA may be used instead of the * )
UTILITIES (Contd.)
– Utility Control Statement Coding Rules
• The utility control statement may also be coded as a
sequential data set or a member of a PDS on the //SYSIN DD
statement
//SYSIN DD DSNAME=TSOI044.CNTL,DISP=SHR
//SYSIN DD DSNAME=TSOI044.CNTL(member),DISP=SHR
• The utility control statement may also be coded as a DUMMY
data set if no editing is required. DUMMY may be coded when
using IEBGENER
• The abbreviation DSN for DSNAME is not accepted in the
utility control statement. You must always code DSNAME
• VOL=device=serial field in the utility control statement. Here,
device is the same as unit=device in the DD statement. The
serial is the same as the VOL=SER=serial in the DD
statement.
Exercises
1.Write down the JCL code for moving “WELCOME TO USSWI” to a
dataset ABC.DFG.SEQ
2.Assume that the above dataset is a partitioned dataset move the
above
data to its member.
3.Write down the JCL code for renaming and deleting 2 members of a
dataset ABC.SDE.DEL
4.Write down the JCL code for copying 4 members of the dataset
ABC.SDE.DEL to ADS.MER.NEW
MODULE 6
Concatenation of Datasets & Rules
Concatenation is the grouping a set of separate datasets into a single
logical dataset

Rules of Concatenation
1.Maximum of 255 sequential datasets
2.Maximum of 16 partitioned datasets
3.Partioned and sequential datasets cannot be mixed
4.Members of a partitioned datasets are treated as sequential datasets
5.RECFM must be the same on each data being concatenated
6.Coding rules specify that the ddname to be omitted after the first
dataset to be concatenated
Temporary Dataset
A Temporary Dataset is one that is created and deleted
in the same job.There are three ways of creating a temporary dataset
1.Omit the DSN
//A DD UNIT=SYSDA,SPACE=(TRK,1)
2.Code the name with && such as DSN=&&WORK
3.Code the name with & such as DSN=&&WORK
To retain the dataset even after the current step ends ,the
Temporary dataset has to be passed to the next step
by coding PASS in the second sub-option of the DISP
parameter
Referbacks
Refeback or backward reference is used to obtain the values
from the same parameters in other steps.The presence of *
indicates that referback is being used.
Example:-
//STEP1 EXEC…..
//DD1 DD DSN= A.B.C,….
//STEP2 EXEC ……..
//DD2 DD DSN=*.STEP1.DD1
Special DD Statements
• Use special DD statements to specify private catalogs, private
libraries, and data sets for storage dumps and checkpoints
• Some of the special DD statements are JOBLIB, STEPLIB, JCLLIB,
SYSOUT, SYSIN, SYSPRINT
JOBLIB & STEPLIB
• JOBLIB statement:
– Identifies a private library that the system is to search for the
program named in each EXEC statement PGM parameter in the
job.
– Only if the system does not find the program in the private
library, does it search system libraries.
– Syntax //JOBLIB DD parameter [,parameter ]...[comments ]
– The JOBLIB DD statement must immediately follow the JOB
statement
– There must be no intervening EXEC or other DD statements
between the JOB statement and the JOBLIB statement.
JOBLIB & STEPLIB(Contd)
– The JOBLIB statement must precede the EXEC statement
– If its location is cataloged, it must specify the unit and volume
serial number of device containing the program to be executed
– We can concatenate job libraries
• Code a JOBLIB statement
• Follow this statement with DD statements that define other
private libraries. Omit a ddname for these subsequent DD
statements
– Do not include a JOBLIB DD statement in an in-stream or
cataloged procedure.
JOBLIB & STEPLIB(Contd)
//JOB1 JOB A123,’BHASKAR’
//JOBLIB DD DSN=M1.TEST.LOADLIB,
// DISP=SHR
//STEP1 EXEC PGM=PGM1
//STEP2 EXEC PGM=PGM2
– Here both the programs PGM1 & PGM2 exists in library
M1.TEST.LOADLIB
//JOB2 JOB A124,’ANNA’
//JOBLIB DD DSN=PROGRAM1,
// DISP=SHR,UNIT=333,
// VOL=SER=PACK1
– Here both UNIT and VOL subparameters are included as
PROGRAM1 is uncataloged
JOBLIB & STEPLIB(Contd)
//L140 JOB (00124,'PURGE PGM'),
// CLASS=N,MSGCLASS=P,TIME=1440,REGION=6M
//JOBLIB DD DSN=IPHP.BT.PGMLIB,DISP=SHR
// DD DSN=IPHP.OL.PGMLIB,DISP=SHR
// DD DSN=SYS5.PROSERV.EXITS,DISP=SHR
// DD DSN=S00P.BT.PGMLIB,DISP=SHR
// DD DSN=S00P.OL.PGMLIB,DISP=SHR
JOBLIB & STEPLIB(Contd)
• STEPLIB statement:
– Create a private library.
– Identify a private library that the system is to search for the
program named in the EXEC statement PGM parameter.
– If the system does not find the program in the private library,
only then does the system search the system libraries.
– Syntax //STEPLIB DD parameter [,parameter ]...[comments ]
– Overriding a JOBLIB
• If the system lib is defined in a STEPLIB DD statement then
the system will ignore the JOBLIB DD statement for that
step.
JOBLIB & STEPLIB(Contd)
• //PAYROLL JOB BAKER,MSGLEVEL=1
• //JOBLIB DD DSNAME=LIB5.GROUP4,DISP=(OLD,PASS)
• //STEP1 EXEC PROC=SNZ12
• //STEP2 EXEC PGM=SNAP1
• //STEPLIB DD DSNAME=LIBRARYP,DISP=(OLD,PASS),
• // UNIT=335 ,VOLUME=SER=55566
• //STEP3 EXEC PGM=A153
• //STEP4 EXEC PGM=SNAP11
• //STEPLIB DD DSNAME=*.STEP2.STEPLIB,
• // DISP=(OLD,KEEP)
– The system searches LIBRARYP for program SNAP10; LIBRARYP is
passed to subsequent steps of this job. The STEPLIB DD statement in
STEP4 refers to the LIBRARYP library defined in STEP2; the system
searches LIBRARYP for SNAP11. Since a JOBLIB DD statement is
included, the system searches for programs SNZ12 and A1530 first in
LIB5.GROUP4, then in SYS1.LINKLIB.
JCLLIB
• JCLLIB Statement
– JCLLIB is used to identify a private library or a system library from
which INCLUDE groups and JCL procedures are to be retrieved.
– The order in which the library names appear on the JCLLIB statement is
the order in which they are searched for any JCL procedures (PROCs)
and INCLUDE groups referenced by this job.
– Syntax
//[name ]JCLLIB ORDER=(library [,library ]...)[comments ]
– The private libraries that you specify on the JCLLIB statement must
comply with following rules:
The private library must be cataloged.
The private library must be accessible to the job.
– JCLLIB statement should be coded after JOB statement and before first
exec statement.
– //JCLLIB DD DSN=MMA2.PROCLIB,DISP=SHR
Special DD Names
• SYSOUT Statement:
– Specifies one character output class associated with SYSOUT
dataset
– Syntax SYSOUT=class
– If SYSOUT=* then output class specified in MSGCLASS
parameter of JOB statement is used
– Routes the system output to the class associated with output
device indicated
– class can be any alphanumeric character from A – Z, 0 – 9 or *
Special DD Names(Contd)
• SYSIN DD Statement
– The SYSIN DD statement is used to identify in-stream data sets.
– The data sets are marked by a DD * or a DD DATA parameter.
– Actually, these DD statements can have any DD name and SYSIN can
be one of these DD names.
– Syntax:
//SYSIN DD *
or
//SYSIN DD DATA ,DLM=xx
– Subparameter Definition:
In the above syntax, the following subparameters are used:
Special DD Names(Contd)
• * - indicates data than terminates with the /* Statement.
• DATA - indicates the data may contain special characters.
• DLM - indicates the two characters in the data that will terminate
the data set
– Examples:
//STEPA EXEC PGM=PROGRAM1
//SYSIN DD DATA,DLM=MY
data record 1
data record 2
...
data record n
MY end of data
Special DD Names(Contd)
• SYSPRINT Statement :
– SYSPRINT is job control statement used for defining a
sequential dataset for messages.The dataset can be written into
the system output device,a tape volume or a DASD volume.
– The block size for the SYSPRINT data set must be a multiple of
121.
Special DD Names(Contd)
• SYSUDUMP DD Statement :
– Produces a dump of user areas. The dump is formatted, so that
it can be printed directly.
– Example
//STEP2 EXEC PGM=A
//SYSUDUMP DD SYSOUT=A

• The SYSUDUMP DD statement specifies that you want the


dump routed to system output class A.
Special DD Names(Contd)
• SYSMDUMP DD Statement :
– Produces a dump of the system areas and the program's address
space.
– The dump is unformatted and machine-readable, to be used, it
must be printed by the interactive problem control system (IPCS).
– Example 2
//SYSMDUMP DD DSNAME=DUMP,DISP=(NEW,KEEP),

// UNIT=3400-6,VOLUME=SER=147958

• The SYSMDUMP DD statement specifies that the dump is to


be stored on a tape. Because the LABEL parameter is not
coded, the tape must have IBM standard labels.
Special DD Names(Contd)
• SYSABEND DD Statement :
– Produces a dump of user and system areas; this dump contains
all the areas dumped in a SYSUDUMP.
– Example
//STEP1 EXEC PGM=PROGRAM1
//SYSABEND DD
DSNAME=DUMP,UNIT=3350,DISP=(,PASS,KEEP),
// VOLUME=SER=1234,SPACE=(TRK,(40,20))

//STEP2 EXEC PGM=PROGRAM2


//SYSABEND DD DSNAME=*.STEP1.SYSABEND,
// DISP=(OLD,DELETE,KEEP)
Symbolic Parameters
• Symbolic Parameters
– Variables used in the PROC statement to substitute default or
supplied values.
– Specified with an ‘&’ symbol. They are used to override
parameters in the DD statement. They can be used in in-stream
as well as catalogued procedures.
– In a typical situation there may be many programmers who are
using the same JCL for opening, reading and writing into data
sets. The only difference being the parameters required to
access the data sets. In such a situation symbolic parameters are
a convenient means of assigning different parameters to
commonly used JCL procedures. Symbolic parameters can be
used with parameters sub parameters and hard coded values as
well.
Symbolic Parameters (Contd)
• Rules for coding symbolic parameters:
– A symbolic parameter can be 1 to 8 alphanumeric or national characters
including ampersand. The first character should be ampersand(&) and
the second character must be alphabetic or national. The subsequent
characters can be alphanumeric or national.
– They must be coded in the operand field only.
//NAME OPERATION OPERAND COMMENTS
//DD1 DD SYMBOLIC PARAMETER COMMENTS
– Value assigned to a symbolic parameter may be overridden by another
provided the redefinition is within the same job. If not overridden the
same value will be assigned to it each time it is called.
– There is no restriction on the length of the value assigned to a symbolic
parameter but, the assignment must fit on the same line. It cannot
continue to the next line.
Symbolic Parameters (Contd)
– If positional parameters are coded as symbolic parameters then
a period should be inserted between them .
– Symbolic parameters cannot be concatenated with other
symbolic parameters or other regular parameters to produce a
new symbolic parameter. They can be concatenated retaining
the value originally assigned to them.
– Concatenated parameters cannot exceed 120 characters.
– If a symbolic parameter is defined then it must be assigned a
value and used within the procedure that defined that parameter.
Symbolic Parameters (Contd)
• Example:
// MYPROC PROC NAME=‘MY.FILE’, STUFF=‘SHR’
// EXEC PGM=MYPGM
// DD1 DD DSN=&NAME, DISP=&STUFF
// PEND
SET & INCLUDE Statement
The SET statement is another way of assigning values to
Symbolic parameters The values of the Symbolic
parameter set by a SET statement will remain in effect
until the end of the Job or until changed by another SET
statement
Example:-
//MYPROC PROC A=ABC B=SYSDA
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=A.B.C,DISP=SHR,
// VOL=SER=&A,
// UNIT=&B
//SET1 SET A=ADC,B=SYSDA
SET & INCLUDE Statement(Contd)
Using the INCLUDE statement you can copy statements
from any member of the PDS listed in the JCLLIB
statement
For Example:-
//MYJOB JOB
//DD1 JCLLIB ORDER=COMMON.PDS
//STEP1 EXEC PGM=IEFBR14
//INDD DD DSN=A.B.C,DISP=SHR
//INC1 INCLUDE MEMBER=COMMON
Exercise
1.Write down the JCL code for creating a temporary dataset
and using it in the next step.
2.Write down the JCL code for concatenating three datasets in the
reverse order.
3.Write down the JCL code for concatenating three members of a
dataset and store the result in a new member
4.Use symbolic parameters for overriding JCL parameters and
try the same using SET statement
MODULE 7
Instream Procedures
• Instream Procedures
– An in-stream procedure is different in that they are not members
of partitioned datasets.
– They are included in input stream of job itself.
– Rules for coding IN-STREAM PROC’s
• They must begin with PROC statement
• They end with PEND statement
• They must be coded immediately after JOB statement &
before first EXEC statement
• No more than 15 in-stream procedures can be coded in a
Job.
Instream Procedures (Contd)
//JOB1 JOB (A123),NAME
//INST1 PROC
//STEP1 EXEC PGM=PROGRAM1
//DD1 DD DSN=FILE1,DISP=SHR
//STEP2 EXEC PGM=PROGRAM1
//DD2 DD DSN=FILE2,DISP=DHR
// PEND
//STEP3 EXEC INST1
– The EXEC statements between PROC & PEND statements are
not executed when they are first encountered in the Job Stream,
but are saved as a procedure so that they can be executed later.
It is executed when the EXEC statement mentioning the IN-
STREAM procedure is encountered
Catalogued Procedures

• Catalogued Procedures
– A procedure that you catalog in a library is called a cataloged
procedure.
– A cataloged procedure may consist of these JCL statements:
CNTL, command, DD, ENDCNTL, EXEC,
IF/THEN/ELSE/ENDIF, INCLUDE, OUTPUT JCL, and SET.
Optionally, a cataloged procedure can begin with a PROC
statement and end with a PEND statement. If coded, PROC
must be the first statement in the procedure.
Catalogued Procedures(Contd)
– Cataloging a Procedure
• The library containing cataloged procedures is a partitioned
data set (PDS) or a partitioned data set extended (PDSE).
The system procedure library is SYS1.PROCLIB. The
installation can have many more procedure libraries with
different names. You can also have procedures in a private
library. The name of a cataloged procedure is its member
name or alias in the library.
• When a cataloged procedure is called, the calling step
receives a copy of the procedure; therefore, a cataloged
procedure can be used simultaneously by more than one job.
Modifying Procedures
• JCL Overrides
– It is done whenever there is a need to override one or more
parameters in procedures. For example there is a JCL coded in
a procedure, which accesses a specific data set for a specific file
name. Instead of having to rewrite the procedure for the new
data set name we can easily override this parameter in the DD
statement without actually changing the contents of the original
procedure. The overrides for a procedure are activated only for
the duration of the job in which they exist. The original
parameters stay intact.
– Syntax
//MYPROC EXEC PROCNAME
//PROCSTEP.DDNAME DD MOD_PARAMETER1,
// MOD_PARAMETER2
Modifying Procedures(Contd)
– MYPROC is the stepname in the job that the procedure will be
executed from, PROCNAME is the name of the procedure
whose parameters will be overridden. PROCSTEP is the
stepname in the procedure whose parameters will be
overridden. DDNAME is the ddname of the DD statements
containing those parameters. The DD operation field may be
followed by one or more modified parameters
Modifying Procedures(Contd)
• Sample JCL for overriding parameters in a procedure :
In the input stream:
//JOB1 JOB ,'H.H. MORRILL'
//ADD1 OUTPUT COPIES=2
//STEPA EXEC PROC=P
//PS1.OUTA OUTPUT CONTROL=DOUBLE,COPIES=5
//PS1.DSB DD OUTPUT=*.ADD1
//PS1.DSE DD *
. (data) .
/*
Modifying Procedures(Contd)
//PS2.OUTB OUTPUT DEFAULT=YES,DEST=STL
In SYS1.PROCLIB member P:
//PS1 EXEC PGM=R15
//OUTA OUTPUT CONTROL=PROGRAM
//DSA DD SYSOUT=C,OUTPUT=*.OUTA
//DSB DD SYSOUT=D,OUTPUT=*.OUTA
//PS2 EXEC PGM=T48

//DSC DD SYSOUT=A
Exercise
1.Which of the following can be included in a procedure?
i)JOB statement ii)EXEC statement iii)DD * statement iv)//(delimiter)

2.Which of the following statements in starting a procedure is right?


i)inproc proc ii) proc inproc
MODULE 8
KEYWORD
PARAMETER=COND
• COND:
– This parameter is used to test the return codes from previous job
steps inorder to determine if the present step is to be executed or
bypassed.
– Syntax= COND[.procstepname]=(code,relational
operator,[stepname])
– Condition codes can range from 0 to 4095. Common condition
codes are:
• 0 no errors or warnings detected
• 4 possible error (warning) detected but execution is possible.
• 8 serious error detected, likely to fail.
• 12 severe error detected, execution impossible.
• 16 terminal error, execution cannot continue
KEYWORD
PARAMETER=COND (Contd)
– If the return code on the JOB statement is satisfied ,the COND
parameter coded in the JOB statement will over ride COND
parameter coded in the EXEC statement.
– The relational operators that can be used are GT, GE, LT, LE,
EQ & NE.
KEYWORD PARAMETER=COND
(Contd)
• Examples
– //STEP6 EXEC PGM=DISKUTIL,COND=(4,GT,STEP3)
– In this example, if the return code from STEP3 is 0 through 4,
the system bypassesSTEP6. If the return code is greater than 4
the system executes STEP6.
– If COND=EVEN the MVS executes the Jobstep whether or not
the previous step has abended.
– COND=ONLY is used for steps that perform recovery
processing that should be invoked only in the event of an abend.
It helps MVS to execute the Jobstep only if a previous step has
abended.
Common Abend Codes
• ABEND CODE 013
– ERROR ID: IEC141I
– DESCRIPTION: The system could not OPEN one of your
datasets properly,generally because of an incorrect DCB
parameter (BLKSIZE), or it could not find the specified member
of a partitioned dataset.
– CORRECTIVE PROCEDURE: Check the BLKSIZE in the DCB
parameter to insure that it matches the BLKSIZE of the dataset.
Common Abend Codes (Contd)
• ABEND CODE 0C1
– ERROR ID: none
– DESCRIPTION: The computer tried to execute an invalid
machine instruction and an operation exception occurred.
– CORRECTIVE PROCEDURE: Check the overlaying portion of
your program. Accidentally overlaying part of your program with
data (subscript out of range) or bad addresses will produce this
error.
Common Abend Codes (Contd)
• ABEND CODE 0C4
– ERROR ID: none
– DESCRIPTION: This is a storage protection violation generally
caused by your program trying to STORE data in memory that is
not allocated for your use.
– CORRECTIVE PROCEDURE: Make sure any subscripts used
do not exceed the boundary specified. Correct all bad addresses
in a store-type statement.
Common Abend Codes (Contd)
• ABEND CODE 106
– ERROR ID: none
– DESCRIPTION: A system software or disk problem occurred
during the execution of a LINK or LOAD instruction.
– CORRECTIVE PROCEDURE: Insure that the load request in the
problem was specified correctly and was not incorrectly
modified, then resubmit the job
Common Abend Codes (Contd)
• ABEND CODE 213
– ERROR ID: IEC143I
– DESCRIPTION: The system tried to open a DASD data set and
encountered difficulties. This ABEND customarily occurs when
the dataset name specified in the DSNAME parameter does not
exist.
– CORRECTIVE PROCEDURE: If the dataset is catalogued,
make sure the spelling is correct. If the dataset is not
catalogued, insure that the proper volume was specified on the
VOL=SER parameter
Common Abend Codes (Contd)
• ABEND CODE 222
– ERROR ID: IEF301I
– DESCRIPTION: The operator cancelled the job.
– CORRECTIVE PROCEDURE: If no message is given in
JESMSG,contact the operator for an explanation. Many times
the error is caused by improperly accessing a magnetic tape
Common Abend Codes (Contd)
• ABEND CODE 2F3
– ERROR ID: none
– DESCRIPTION: The job was executing when a system failure
occurred
– CORRECTIVE PROCEDURE: Resubmit the job if your results
are unsatisfactory and contact Technical Support for a job cost
reimbursement
Common Abend Codes (Contd)
• ABEND CODE 322
– ERROR ID: none
– DESCRIPTION: Execution of a job, job step, or catalogued
procedure step took longer than the time specified.
• If no time was specified in the TIME parameter on your job
card, the job was given the default value of 30 seconds.
– CORRECTIVE PROCEDURE: Check for program errors, such
as endless loops.
• Correct any such errors and rerun the job.
• If no such errors were found, increase the time and rerun the
job.
Common Abend Codes (Contd)
• ABEND CODE 613
– ERROR ID: IEC147I
– DESCRIPTION: An input/output (I/O) error occurred during
execution of an OPEN instruction for a dataset on magnetic
tape.
• The error resulted in either reading or writing incorrectly a
tape label or mark, or positioning a tape volume.
• This error typically occurs in standard label processing for
multiple tape files.
– CORRECTIVE PROCEDURE: Rerun the job, since
malfunctioning equipment has likely produced the error
Common Abend Codes (Contd)
• ABEND CODE 722
– ERROR ID: none
– DESCRIPTION: The system cancelled your job because an
output limit was exceeded for lines being printed or cards being
punched.
– CORRECTIVE PROCEDURE: Assuming that the program is
correct, increase the appropriate specification by use of a MAIN
card.
• IF lines were exceeded (default=5000), the LINES parameter
(in thousands) should be increased accordingly.
• If cards were exceeded (default=500), the CARDS
parameter (in hundreds) should be increased
Common Abend Codes (Contd)
• ABEND CODE 804
– ERROR ID: none
– DESCRIPTION: Your job requested more virtual storage
(memory) than the amount that was available.
– CORRECTIVE PROCEDURE: Increase the REGION parameter
on the abending step's EXEC card.
• If no region parameter was specified, the default value for
the procedure being executed was assumed
Common Abend Codes (Contd)
• ABEND CODE 806
– ERROR ID: none
– DESCRIPTION: This error occurred during execution of a LINK
or LOAD instruction. The system was unable to locate a load
module.
– CORRECTIVE PROCEDURES: Make sure the spelling of the
load module name or program name is correct or that the
appropriate STEPLIB or JOBLIB DD card defining which library
the load module resides in is included in you JCL stream.
Common Abend Codes (Contd)
• ABEND CODE 813
– ERROR ID: IEC149I
– DESCRIPTION: During execution of an OPEN instruction for a
dataset on magnetic tape, the dataset name on the header label
of the tape did not match that specified on the DD card.
– CORRECTIVE PROCEDURE: Insure that the DD statement
specifies the correct DSNAME, volume serial number, and label
for the tape being accessed.
Common Abend Codes (Contd)
• ABEND CODE 913
– ERROR ID: IEC150I
– DESCRIPTION: An OPEN instruction was issued for a RACF-
protected dataset on a DASD volume which your userid was not
authorized to access.
• RACF only allows you to access datasets with a high level
qualifier the same as your userid or which you have been
explicitly given access permission to by the owner of the
dataset.
– CORRECTIVE PROCEDURE: Make sure you have the needed
access authority to the dataset.
Common Abend Codes (Contd)
• ABEND CODE A13
– ERROR ID: IEC151I
– DESCRIPTION: The system tried to OPEN a non-existent
dataset on magnetic tape. The system encountered the end-of-
volume tape mark when forward spacing to the file you specified
in the LABEL parameter on the DD card.
– CORRECTIVE PROCEDURE: Check the file sequence number
and volume serial number from the previous job that created the
dataset.
Common Abend Codes (Contd)
• ABEND CODE B37
– ERROR ID: IEC030I
– DESCRIPTION: This error results if either one of two situations
occurs.
• Firstly, if the DASD volume to which the system has
assigned one of the program's output datasets does not have
enough available space to allow the necessary secondary
allocations to be made.
• Secondly, this ABEND can occur if the output dataset used
all 16 extents of secondary allocations but still required more
space.
Common Abend Codes (Contd)
– CORRECTIVE PROCEDURE: Estimate the space required for
the output dataset before rerunning your program.
• If possible, decrease the amount of space requested or if
more space is obviously needed increase the primary and or
secondary allocations.
Common Abend Codes (Contd)
• ABEND CODE D37
– ERROR ID: IEC031I
– DESCRIPTION: An output dataset used all the primary space
and no secondary space was requested.
– CORRECTIVE PROCEDURE: Increase the primary allocation or
add a secondary allocation to the space parameter for that
output dataset.
Common Abend Codes (Contd)
• ABEND CODE E37
– ERROR ID: IEC032I
– DESCRIPTION: If creating a dataset on tape, all space available
on the volume specified was used and the system attempted to
write another record.
• If creating a partitioned dataset on direct access, 16 extents
of secondary space were used when the program attempted
to write another record.
– CORRECTIVE PROCEDURE: Specify at least one more tape
volume or specify more primary space if creating a partitioned
dataset.
Operators
The format of COND parameter is as follows
COND=(value,operator,stepname)

Following are the COND operators


GT greater than
LT less than
EQ equal to
NE not equal to
GE greater than or equal to
LE less than or equal to
MODULE 9
GDG-Use of GDGs
• A generation data group (GDG) is a group of functionally and
chronologically related data sets.
• They are processed periodically, often by adding a new generation,
retaining previous generations, and sometimes discarding the oldest
generation.

• Example
– An Income Tax report is a generation data group with a new
generation added each year, chronologically and functionally
related to previous years. When a new generation is added, the
four previous reports must be retained for legal purposes, but
the fifth may be discarded.
– Generation data groups are referred to by a name and a relative
generation number.
Define a GDG
• For eg; DSN=A1000.TAX.STATE(0) refers to the current Tax report
• DSN=A1000.TAX.STATE(-1) refers to the previous Tax
report
• DSN=A1000.TAX.STATE(+1) refers to the new Tax report
that is to be created
• Creation of a GDG:
– The DEFINE GENERATIONDATAGROUP command creates a
catalog entry for a generation data group (GDG).
– A GDG can contain both SMS- and non-SMS-managed
generation data sets.
– A generation data set (GDS) cannot be a VSAM data set.
Define a GDG(Contd)
• Example 1: Creation of a GDG & GDS using a model data set.
//DEFGDG1 JOB ...
//STEP1 EXEC PGM=IDCAMS
//GDGMOD DD DSNAME=GDG01,DISP=(,KEEP),

// SPACE=(TRK,(0)),UNIT=DISK,VOL=SER=VSER03,

// DCB=(RECFM=FB,BLKSIZE=2000,LRECL=100)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE GENERATIONDATAGROUP -
(NAME(GDG01) -
EMPTY -
NOSCRATCH -
LIMIT(255) )
/*
Define a GDG(Contd)
//STEP1 EXEC PGM=IEFBR14
//*
//* VSER03 must be the volume of GDGs catalog volume
//*
//GDGDD1 DD DSNAME=GDG01(+1),DISP=(NEW,CATLG),
// SPACE=(TRK,(10,5)),VOL=SER=VSER03,
// UNIT=DISK
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
/*
//
Note : GDGMOD DD, which describes the GDG. When the scheduler
processes the DD statement, no space is allocated to GDG01.

The model DSCB must exist on the GDGs catalog volume.


Define a GDG(Contd)
• Example 2: Creation of a GDG & GDS in SMS-managed storage.
– In this example, a GDG is defined with access method services
commands and then JCL is used to define a GDS into the newly defined
GDG. It is assumed that the storage administrator has created a storage
class named GRPVOL1 and a data class named ALLOCL01
//DEFGDG JOB ...
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
DEFINE GENERATIONDATAGROUP -
(NAME(ICFUCAT1.GDG02) -
EMPTY -
NOSCRATCH -
LIMIT(255))
/*
Define a GDG(Contd)
//DEFGDS JOB ...
//STEP1 EXEC PGM=IEFBR14
//GDSDD1 DD
DSN=ICFUCAT1.GDG02(+1),DISP=(NEW,CATLG),
// SPACE(TRK,
(5,2)),STORCLAS=GRPVOL1,DATACLAS=ALLOC01
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
/*
Note: Because the GDG is created in SMS-managed storage and its
catalog,ICFUCAT1, is on an SMS volume, any dependencies on
pattern DSCBs should be removed
Deleting a GDG
Deleting a GDG Catalog Entries and Model DSCBs

Deleting a Model(undoes a define model)


//S1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE EDUC.MODEL PURGE
Deletes a GDG entry(undoes an allocated GDG and deletes all GDGs)
//S2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE EDUC.GDG.BASE FORCE
MODULE 10
JES2 Control Statements
• Job Entry Subsystem 2 (JES2) statements :
– supply the information relating to execution of jobs within a
decentralized network of computers
– Rules for coding JES2 statements
• JES2 statements are optional and immediately follow the job
statement.
• JES2 statements have /* in the identifier field instead of //
• JES2 statements cannot be placed inside cataloged procedures
• Basic JES2 Statements
– Message Statement :The message statement is used to convey
information to the system operator(s).
• Syntax /*MESSAGE message where message stands for the
message which is send to system operator
• //JOB1 JOB A123,’MARINA’
• /*MESSAGE PLEASE CALL #2344 AFTER JOB COMPLETION
JES2 Control
Statements(Contd)
– JOBPARM :specifies processing options for job
• Parameters that can be coded with JOBPARM are
– LINECT – used to specify number of lines to be printed on
each page of output
– NOLOG – used to specify that no job log is required
– COPIES=n – used to specify the number of copies of output
required
– BYTES=n – used to set a limit on size of output in thousands
of bytes
– PAGES=n – used to set limit on number of pages of output
produced by a job
– //JOB3 JOB A125,’DEEPAK’
– /*JOBPARM BYTES=1000,PAGES=100,LINECT=40
JES2 Control
Statements(Contd)
– OUTPUT statement: used to route output to specific nodes
• Parameters coded with this are
– LINECT=n – used to specify the number of lines of output per
pages of output, n can range from 0 to 255
– FORMS=n – used to identify print forms to which output is
routed
– COPIES=n – used to specify the number of copies of output, n
can range from 1 to 255
– DEST=destination – used to specify destination of output
– PRIORITY statement : used to specify the priority of job that is to be
executed
• Must precede JOB statement
• Priority numbers can range from 0-15
– /*PRIORITY 4
– //JOB1 JOB D12,’ANIL’
JES2 Control
Statements(Contd)
– SETUP statement : used to indicate the tape volumes that will be
required in execution of a job
• //JOB1 JOB A127,’ANISH’
• /*SETUP 00123,00250
– NOTIFY statement : used to notify a user of completion of a job
• //L065 JOB (00124),‘GEN TEST',
• /*NOTIFY NODE1.USER
– Here NODE1 is node name, USER is ID of user who will
be notified of termination of Job L065.
– SIGNON statement : used to start job at a remote location
• /*SIGNON REMOTEnnnPW1 where nnn identifies the remote
node and PW1 is the password associated with remote node
at which job is to be executed. Passwords are optional.
JES2 Control
Statements(Contd)
– SIGNOFF statement : used to terminate a job that has been
started at a remote node
• //JOB4 JOB S123,’ATUL’
• /*SIGNOFF
JES3 Control Statements

JES3 handles resource management and workflow management before and after
execution or processing. The main functions of JES3:
• 1.Gather Jobs and data from local and remote input devices.
• 2.Present Jobs to the system scheduler for execution.
• 3.Monitor the execution.
• 4.print the output produced by the jobs on local & remote devices.
• 5.Remove Jobs from the system when complete
JES3 Control Statements(Contd)
• Some JES3 statements:
• //*Main
• //*Format
The //*MAIN statement is used to define the JES3 processor
requirements for your job.The //*MAIN statement consists of the
characters //*MAIN in columns 1 through 7, a blank in column 8, and
the necessary parameters anywhere in columns 9 through 72. You
should insert the //*MAIN statement for your job after the JCL JOB
statement and before the first EXEC statement in the job. //*MAIN
parameter{,parameter} ...
MODULE 11
DFSORT
• DFSORT is a program used to sort records in ascending or
descending
sequence, or to merge from 2 to 16 different files into one file.
• The input and output files processed by DFSORT can be sequential
or VSAM files containing fixed-length or variable-length format
records.
• DFSORT can be used in two ways
– Stand-alone sort/merge
Here, the DFSORT is invoked directly in an EXEC statement
– Internal sort/merge
Here, the DFSORT is invoked from a program written in a
high- level language.
DFSORT (Contd)
• Sorting Data Sets
– Sorting is arranging records in either ascending or descending order
within a file.
– The job control language (JCL) you need to do a sort depends on
whether you run DFSORT with the JCL EXEC statement or call
DFSORT from a program.
– The JCL statements you need for most jobs are described below.
• //jobname JOB
Signals the beginning of a job.
• //stepname EXEC
Signals the beginning of a job step and tells the operating
system what program to run.
//stepname EXEC PGM=SORT
DFSORT (Contd)
• //STEPLIB DD
Defines the library containing the DFSORT program
• //SYSOUT DD
Defines the output data set for messages.
• //SORTIN DD
Defines the input data set.
• //SORTWKdd DD
Defines a work storage data set for a sort.
• //SORTOUT DD
Defines the output data set.
• //SYSIN DD
Precedes the DFSORT program control statements.
DFSORT (Contd)
• Example
//EXAMP JOB A492,PROGRAMMER
//SORT EXEC PGM=SORT
//STEPLIB DD DSN=A492.SM,DISP=SHR
//SYSOUT DD SYSOUT=A
//SORTIN DD DSN=A123456.SORT.SAMPIN,DISP=SHR
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SORTOUT DD
DSN=A123456.SORT.SAMPOUT,DISP=OLD
//SYSIN DD *
SORT FIELDS=(110,10,A,145,17,A, 1,75,A),FORMAT=CH
/*
DFSORT (Contd)
• Merging Data Sets
– The MERGE control statement combines two or more identically
sequenced files (that is, files that have already been sorted
according to an identical set of ascending/descending keys) on
one or more keys and makes records available in merged order
to an output file.
– The JCL needed for a merge is the same as that for a sort, with
the following exceptions:
• Do not use the SORTWKdd DD statement
• Instead of the SORTIN DD statement, use SORTINnn DD
statements to define the input data sets.
• The SORTINnn DD statements name the input data sets,
and tell how many data sets will be merged.
• The value nn is a number from 00 to 99, indicating the
number of data sets to be merged.
DFSORT (Contd)
• Example
//EXAMP JOB A492,PROGRAMMER
//SORT EXEC PGM=SORT
//STEPLIB DD DSN=A492.SM,DISP=SHR
//SYSOUT DD SYSOUT=A
//SORTIN01 DD DSN=A123456.MASTER,DISP=OLD
//SORTIN02 DD DSN=A123456.NEW,DISP=OLD
//SORTOUT DD DSN=A123456.SORT.SAMPOUT,DISP=OLD
//SYSIN DD *
MERGE FIELDS=(110,5,A,1,75,A),FORMAT=CH
/*
DFSORT (Contd)
• Copying Data Sets
– DFSORT can also copy data sets without any sorting or merging
taking place.
– COPY can be used with all of the other DFSORT control
statements except SUM.
– The JCL for a copy application is the same as for a sort, except
SORTWKdd DD statement should not be used.
– The sample JCL shown as an example below will copy a data
set using the OPTION COPY statement
DFSORT (Contd)
• Example
//EXAMP JOB A492,PROGRAMMER
//SORT EXEC PGM=SORT
//STEPLIB DD DSN=A492.SM,DISP=SHR
//SYSOUT DD SYSOUT=A
//SORTIN DD DSN=A123456.SORT.SAMPIN,DISP=SHR
//SORTOUT DD DSN=A123456.SAMP.SORTOUT,DISP=OLD
//SYSIN DD *
OPTION COPY
/*
SORT FIELDS=COPY or MERGE FIELDS=COPY can be used
instead of OPTION COPY to produce the same results.
DFSORT (Contd)
• Parameters used in SORT
– The parameters used in SORT are INREC,OUTREC,INCLUDE,
OMIT, STOPAFT, OUTFIL,SUM
• INREC
– Reformats records before they are sorted, copied, or merged
• OUTREC
– Reformats records after they are sorted, copied, or merged
• INCLUDE
– INCLUDE control statement is used to collect the wanted records
• OMIT
– OMIT control statement is used to exclude the unwanted records
• STOPAFT
– STOPAFT is used to specify the maximum number of records that
should be accepted for sorting or copying.
DFSORT (Contd)
• SKIPREC
– SKIPREC is used to skip a specified number of records at the
beginning of the input file being sorted or copied.
• OUTFIL
– OUTFIL is used to create a multiple output dataset and reports
from a single pass over the input data set.
• SUM
– SUM is used to add the contents of fields whenever two records
with equal control fields are found. DFSORT places the result in
one record and deletes the other, reducing the number of
records to be sorted or merged.
– Delete records with duplicate control fields by specifying
FIELDS=NONE in a SUM statement
Tape Management System
• TMS Expiration and Retention Dates
• TMS selects volumes for deletion based upon the expiration date
supplied via parameter EXPDT or the retention period supplied via
JCL parameter RETPD. The value supplied via RETPD is converted
to a date. If no EXPDT or RETPD value is supplied, then the TMS
will take the default
retention period which is installation specific.
• Certain values supplied for EXPDT are TMS codes, rather than true
dates. The only currently valid TMS codes are explained below:
• 98000 - Used for external tapes unknown to TMS; used only when
reading a tape created by an outside agency or when writing to a
non-NWRDC tape volume
Tape Management
System(Contd)
• 98nnn - Retain for nnn days before scratching
• 99000 - CATLG controlled; i.e., when the dataset is uncataloged,
the tape will subsequently be scratched
• 99nnn - Retain for nnn cycles before scratching; this should only be
used with datasets with the same name, not with generation data
sets
• 99365 - Retain permanently
• Other values on the JCL EXPDT or RETPD parameters:
• LABEL=RETPD=0 - A temporary data set. If it is for the first file the
volume remains in scratch status after use.
• LABEL=EXPDT=yyyy/ddd - Standard MVS expiration date
• LABEL=RETPD=dddd - Standard system retention period
DFSMS
• Data Facility Storage Management Subsystem, commonly called
system managed storage or SMS Controls disk data set allocation
and management in an MVS environment. The complementary
functions of MVS/DFP and other individual products of the Data
Facility family, which, together with RACF provide a system-
managed, administrator-controlled storage environment.
• Functions :
– Eliminates the need to specify a physical volume when allocating
a data set
– Support for the new self reorganizing type of partitioned
datasets, PDSEs
– SMS data sets are automatically cataloged at creation, which
eliminates problems accompanying uncataloged data sets.

You might also like