Professional Documents
Culture Documents
COURSE OBJECTIVES
• Appreciate the need for Job Control Language.
• Have an overview of Job Control Language in IBM environment.
• Know the structure of Job Control Language statements.
• Know the usage of the various parameters of Job Control
Language statements.
• Know the structure of Job Control Language procedures.
• Know the concept of Generation Dataset Groups.
• Know the purpose and usage of common IBM utilities.
• Be able to write JCLs and test them on MVS workbench.
• Appreciate the relation between COBOL program and JCLs.
2
SESSION -- I
3
OBJECTIVES
To understand
• What is a JCL ?
• Why JCL is required ?
• Overview of Job Entry Sub-System
• Various components of a JCL statement.
4
JOB CONTROL LANGUAGE ( JCL )
5
• Specifications for a job are
* User identity.
* Data file identity.
* Resource Requirement.
* Error handling.
6
WHY JCL ?
7
JOB ENTRY SUB SYSTEM
8
HOW JOB IS EXECUTED
Contd..
9
HOW JOB IS EXECUTED ( Contd..)
• The Initiator then creates a user region, loads the user program
into it and transfers control to the user program.
• When the execution of user program is complete, the initiator
invokes routine to deallocate the resources used by the job step.
10
OUTPUT LISTING GENERATED AFTER JOB
EXECUTION
11
BASIC FORMAT OF JCL STATEMENTS
Explanation
Contd..
12
Operation A valid operation code,such as JOB,EXEC,or DD.
Must be preceded and followed by a space.
13
E.g.. The statements in the sample JCL can be categorized
into five different fields.
14
SESSION -- II
15
OBJECTIVES
To understand
• Job statement
16
17
‘JOB’ STATEMENT
INTRODUCTION
18
The format of the statement is as given below.
19
JCL PARAMETERS ON THE JOB STATEMENT
Contd..
20
(JCL PARAMETERS ON THE JOB STATEMENT Contd...)
21
JOBNAME
22
Some examples of valid job names
//cci9393
//r4
23
POSITIONAL PARAMETERS IN JOB
STATEMENT
24
JOB ACCOUNTING INFORMATION
PARAMETER
SYNTAX
25
EXAMPLE 1 :
JOB1 is the name of the job. JOB is the operation. A123 is the
account number. DEPT1 is the additional accounting information.
Since both the parameters are coded, they are enclosed in the
parenthesis.
EXAMPLE 2 :
26
PROGRAMMER-NAME PARAMETER
. Programmer name
SYNTAX
27
EXAMPLE :
28
KEYWORD PARAMETERS
CLASS
PRTY
MSGCLASS
MSGLEVEL
TYPRUN
NOTIFY
29
‘CLASS’ PARAMETER
30
SYNTAX
EXAMPLE :
31
‘PRTY’ PARAMETER
SYNTAX
PRTY=priority
32
EXAMPLE :
33
‘MSGCLASS’ PARAMETER
• First, there are those related to the system and the JCL.
34
SYNTAX
MSGCLASS=output-class-name
MSGCLASS
35
EXAMPLE 1 :
36
EXAMPLE 2 :
37
‘MSGLEVEL’ PARAMETER
• First, log messages indicating job name, user name, etc. are
routed to the output device.
Contd..
38
‘MSGLEVEL’ PARAMETER (Contd..)
39
SYNTAX
STATEMENTS:
Coding a 0 in statements will result in messages related to the job
statement only being output.
Contd….
40
SYNTAX (Contd..)
Coding a 1 will result in all JCL in the job being submitted being
output.
In addition to this, if any cataloged procedures are invoked, then
their JCL will also be output.
Coding a 2 will result in only the input JCL statements being
printed.
MESSAGES:
In the messages field, 0 or 1 can be coded.
Coding a 0 will result in all allocation messages being output if the
job terminates abnormally.
Coding a 1 will result in all allocation messages being output,
regardless of whether the job terminates normally or abnormally.
MSGLEVEL
41
EXAMPLE 1 :
EXAMPLE 2 :
42
‘ TYPRUN’ PARAMETER
SYNTAX
TYPRUN=HOLD
Or
TYPRUN=SCAN
Contd..
43
‘ TYPRUN’ PARAMETER (Contd..)
44
EXAMPLE 1 :
EXAMPLE 2 :
45
NOTIFY PARAMETER
Example :
//JOB10 JOB NOTIFY=JB007
46
CLASSROOM EXERCISE - I
47
CLASSROOM EXERCISE - II
48
SESSION -- III
49
OBJECTIVES
To understand
• EXEC statement
• Positional parameters and Key word parameters
• The following parameters coded on the EXEC statement
PGM ACCT PARM
ADDRSPC DPRTY PERFORM
RD
• JOBLIB and STEPLIB statements
To try and solve the classroom exercises
50
51
‘ ‘EXEC’ STATEMENT
INTRODUCTION
52
SYNTAX
where stepname is the name assigned to the job step, EXEC is the
operation, program-name is the name of the program ( this is a
positional parameter ) and keyword parameters follow the
positional parameter
53
STEPNAME
54
Conditions In Which Stepname Is Mandatory.
55
POSITIONAL PARAMETERS OF THE EXEC
STATEMENT
PGM parameter.
56
‘PGM’ PARAMETER
SYNTAX
57
KEYWORD PARAMETERS OF THE EXEC
STATEMENT
• The keyword parameters coded for a job step will apply only to
that step.
• Keyword parameters can be coded in any sequence.
• Keyword parameters used in EXEC statement are :
58
‘ACCT’ PARAMETER
SYNTAX
ACCT=(account-information,...)
Or
ACCT=account-information
account-information consists of one or more subparameters
defined by installation.
59
EXAMPLE 1:
EXAMPLE 2:
60
‘PARM’ PARAMETER
• The PARM parameter is used to supply information to a program
as it executes.
SYNTAX
PARM=value
Where value is a string from 1 to 100 characters long.
EXAMPLE 1 :
//STEP1 EXEC PGM=PROGRAM1,PARM=PRINT
PROGRAM1 is executed, and the string “PRINT” is supplied to it
during execution.
61
EXAMPLE 2 :
PARM
62
‘JOBLIB’ AND ‘STEPLIB’ STATEMENTS
63
‘JOBLIB’ STATEMENT
• The JOBLIB statement immediately follows the JOB
statement.
• It is a DD (Data Definition ) statement , and it specifies where
the program that is specified by the EXEC statement resides.
EXAMPLE 1 :
//JOB1 JOB (A123),‘JAI’
//JOBLIB DD DSN=M1.TEST.LOADLIB,
DISP=SHR
//STEP1 EXEC PGM=PROGRAM1
JOBLIB DD statement is used to specify the location of the
program that is to be executed. Program1 is a member of the
partitioned dataset M1.TEST.LOADLIB.
64
EXAMPLE 2 :
JOBLIB
65
EXAMPLE 3 :
JOBLIB
66
‘STEPLIB’ STATEMENT
• The function of the STEPLIB statement is the same as the JOBLIB
statement. This statement is coded after the EXEC statement .
• Is effective only for that jobstep, instead of the entire job.
EXAMPLE :
//JOB1 JOB (1234),‘VENU’
//STEP1 EXEC PGM=PROGRAM1
//STEPLIB DD DSN=PROD.LOADLIB1, DISP=SHR
//STEP2 EXEC PGM=PROGRAM2
//STEPLIB DD DSN=PROD.LOADLIB2, DISP=SHR
Program1 is a member in the PROD.LOADLIB1 and program2 is a
member in the PROD.LOADLIB2.
67
CODING BOTH ‘JOBLIB’ AND ‘STEPLIB’
STATEMENTS
• If both the JOBLIB and STEPLIB statements are coded, then the
STEPLIB specification will override that of the JOBLIB for that
jobstep
• If the same library is used for all jobsteps, then it is good practice
to code the JOBLIB statement.
68
EXAMPLE :
69
‘ADDRSPC’ PARAMETER
70
SYNTAX
ADDRSPC=REAL
Or
ADDRSPC=VIRT
71
EXAMPLE 1 :
//JOB1 EXEC PGM=PROGRAM1,
// ADDRSPC=VIRT
Program1 will be paged.
EXAMPLE 2 :
//JOB2 EXEC PGM=PROGRAM2,
// ADDRSPC=REAL
72
‘DPRTY’ PARAMETER
• Used to assign Dispatching Priority to the job step.
73
SYNTAX
DPRTY=(value1,value2)
74
EXAMPLE :
( 12 * 16 ) + 9 = 192 + 9 = 201
75
‘PERFORM’ PARAMETER
• The PERFORM parameter is used to specify the Performance
Group for the job step.
SYNTAX
PERFORM=n
where n ranges from 1 to 999.
76
EXAMPLE :
77
‘RD’ PARAMETER
• The RD ( Restart Definition) is used to specify automatic restart
of a job if it abends.
78
SYNTAX
RD=R
Or
RD=RNC
Or
RD=NR
Or
RD=NC
79
EXAMPLE 1 :
The operator can perform automatic step restart if the job abends.
The checkpoint macro is not suppressed.
80
EXAMPLE 2:
The operator can perform automatic step restart if the job step
fails. Checkpoints are suppressed.
81
CLASSROOM EXERCISE
82
SESSION -- IV
83
OBJECTIVES
To understand
• The usage of following additional parameters coded on
both JOB and EXEC statement.
REGION
COND
TIME
• The DD statement
• Concept of Temporary datasets and Permanent datasets.
• DSN parameter coded on the DD statement.
To try and solve classroom exercises.
84
85
‘REGION’ PARAMETER
SYNTAX
REGION=value1K
Or
REGION=value2M
Where value1 is the storage in multiples of 1024 bytes, and
value2 is storage in multiples of one million bytes. The K and M
must follow value1 and value2.
86
EXAMPLE 1 :
87
EXAMPLE 2 :
88
EXAMPLE 3:
89
‘REGION’ CODED ON THE
JOB STATEMENT
Usually the system will provide a default region size in which the
job is to execute. However this can be overriden by using the
REGION parameter coded on the JOB statement. If enough storage
space is not specified the job will terminate abnormally.
90
‘COND’ CODED IN THE JOB STATEMENT
A COND parameter coded on the JOB statement applies to all job
steps within the job, and it overrides COND parameters coded on
the EXEC statement, if they exist.
SYNTAX
COND=(comparison-code,condition)
91
SOME COMMON CONDITION CODES
Return Explanation
Code
0 Implies successful execution of job
step
92
OPERATORS CODED ON THE ‘COND’
PARAMETER
Operator Explanation
GT Bypass current step if comparision-code
is greater than the return code.
GE Bypass current step if comparision-code
is greater than or equal to return code.
LT Bypass current step if comparision-code
is less than return code.
93
OPERATORS CODED ON THE ‘COND’
PARAMETER (Contd...)
Operator Explanation
94
EXAMPLE :
95
‘COND’ CODED IN THE EXEC STATEMENT
96
SYNTAX
COND=(comparison-code,condition)
or
COND=(comparison-code,condition, stepname...)
or
COND=EVEN
or
COND=ONLY
97
• Step name specifies the name of the preceding step whose
return code is to be checked.
COND
98
EXAMPLE :
99
‘TIME’ PARAMETER
100
SYNTAX
TIME=(minutes)
or
TIME=(minutes,seconds)
or
TIME=(,seconds)
EXAMPLE :
//JOB1 JOB (A123),‘VENU’,
//STEP1 EXEC PGM=PROGRAM1,
// TIME=5
5 minutes of CPU time is assigned to STEP1.
101
‘TIME’ Coded On Both JOB Statement And
EXEC Statement
102
CLASSROOM EXERCISE
Write a JCL where job name is JOB1,programs to be executed are
COBOL1, COBOL2, COBOL3, COBOL4.
103
104
‘DD’ ( DATA DEFINITION ) STATEMENT
INTRODUCTION
• Deleted.
• Kept.
• Cataloged.
• Passed to subsequent job steps.
• Uncataloged.
105
‘DD’ STATEMENT
106
‘DD’ NAME
• The ddname identifies the name of the data definition
statement.
• As a job executes, the system performs device and space
allocations for each ddname specified.
• Each ddname should be unique within the jobstep.
EXAMPLE :
//JOB1 JOB A123,’VENU’
//STEP1 EXEC PGM=PROGRAM1
//NAME1 DD DSN=DATA1
NAME1 is the DD name.
107
DD NAMES RESERVED FOR THE SYSTEM
USE
The following names are reserved for the system use and may
not be used to define DD statements:
//JOBLIB //JOBCAT
//SYSABEND //SYSIN
//SYSCHK //STEPLIB
//STEPCAT //SYSUDUMP
//SYSOUT //SYSOUD
//SYSDBOUT
108
‘DSN’ PARAMETER
• The DSN parameter is a keyword parameter on the DD
statement. It is used to specify the name of the data set to the
operating system.
SYNTAX
DSN=data-set-name
Where data-set-name can be qualified or non-qualified.
109
QUALIFIED NAMES
DSN parameter
110
EXAMPLE:
111
TEMPORARY DATA SETS
112
EXAMPLE 1:
113
• A temporary data set is also recognized by starting the dataset
name with two ampersands in the DSN parameter .
EXAMPLE 2 :
114
PERMANENT DATA SETS
• A permanent data set is not deleted after a job is completed and
may be cataloged, if requested.
EXAMPLE :
115
CLASSROOM EXERCISE
Write a JCL where job name is JOB1, Two programs COBOL1 and
116
SESSION -- V
117
OBJECTIVES
To understand
• The following parameters and their sub-parameters coded on
the DD statement.
DISP
UNIT
To interpret the examples using the above parameters and their
sub-parameters.
118
‘DISP’ PARAMETER
• DISP is a keyword parameter, used to instruct the system as to
the current status of a data set, and the steps to be taken with the
data set upon normal and abnormal termination of the job.
SYNTAX
DISP=(status,normal-disposition,abnormal-disposition)
• The status field indicates the current status of the data set i.e
whether it exists or has to be created.
Contd...
119
SYNTAX (Contd..)
DISP parameter
120
SUB-PARAMETERS ON ‘DISP’PARAMETER
121
‘NEW’ SUB-PARAMETER
122
EXAMPLE :
123
‘OLD’ SUB-PARAMETER
EXAMPLE :
//JOB1 JOB A123,‘VENU’
//STEP1 EXEC PGM=PROGRAM1
//DATA DD DSN= PROJECT1.GROUP1.JCL(TESTDATA),
// DISP=OLD
124
‘MOD’ SUB-PARAMETER
125
SHR SUB-PARAMETER
• Setting DISP=SHR allows multiple jobs to read the same data set
which already exists.
EXAMPLE :
126
CLASSROOM EXERCISE
Write a JCL where job name is JOB1 and two programs COBOL1
127
NORMAL-DISPOSITION FIELD
SYNTAX
DISP=(status,normal-disposition,abnormal-disposition)
The sub-parameters that can be coded here are :
DELETE
KEEP
CATLG
UNCATLG
PASS
128
‘DELETE’ SUB-PARAMETER
EXAMPLE :
129
‘KEEP’ SUB-PARAMETER
EXAMPLE :
//JOB1 JOB A123,‘VENU’
//STEP1 EXEC PGM=PROGRAM1
//NAME1 DD DSN=BOOKS,
// DISP=(OLD,KEEP)
A permanent data set called BOOKS is retrieved and kept after it
has been read.
130
‘CATLG’ SUB-PARAMETER
131
‘UNCATLG’ SUB-PARAMETER
132
‘PASS’ SUB-PARAMETER
Setting DISP to PASS specifies that the data set is to be passed to
a subsequent job step within the same job.
133
EXAMPLE 1 :
//JOB1 JOB (K123),‘JAI’
//STEP1 EXEC PGM=PROGRAM1
//DATA1 DD DSN=FILE1,
DISP=(NEW,PASS)
//STEP2 EXEC PGM= PROGRAM2
//DATA2 DD DSN=FILE1,
DISP=(OLD,DELETE)
PROGRAM1 creates a new dataset called FILE1.
The DISP parameter is used to pass it on to subsequent steps
within that job.
In STEP2, FILE1 which is passed from the prior step is
accessed. Hence the DISP parameter is : DISP=(OLD,DELETE)
134
EXAMPLE 2 :
//JOB1 JOB (K123),‘JAI’
//STEP1 EXEC PGM=PROGRAM1
//DATA1 DD DSN=FILE1,
DISP=(NEW,PASS)
//STEP2 EXEC PGM= PROGRAM2
//DATA2 DD DSN=*.STEP1.DATA1,
DISP=(OLD,DELETE)
Data passed from STEP1 is accessed in STEP2 via Referback.
Referback follows the following syntax :
DSN=*.stepname.ddname
Where ‘*’ is required, stepname is the name of the step, and
ddname is the DD statement name.
135
EXAMPLE 3 :
136
CLASSROOM EXERCISE
Write a JCL where job name is JOB1 and two programs P1 and
137
ABNORMAL-DISPOSITION FIELD
• The abnormal disposition field tells the system what to do with
the data set upon abnormal termination of the job.
• This subparameter is required only if the abnormal disposition
is different from the normal disposition.
DISP=(status,normal-disposition,abnormal-disposition)
The following subparameters can be used in this field :
DELETE
KEEP
UNCATLG
CATLG
The description of each of the above parameters remain the same
except that now they refer to abnormal termination of the job.
138
EXAMPLE 1 :
139
EXAMPLE 2 :
140
EXAMPLE 3 :
141
CLASSROOM EXERCISE
Write a JCL where job name is JOB1 and two programs P1 and P2
executed.
142
‘DISP’ DEFAULTS
143
‘UNIT’, ‘VOL’ AND ‘LABEL’ PARAMETERS
144
‘UNIT’ PARAMETER
INTRODUCTION
145
‘UNIT’ PARAMETER (Contd...)
146
JCL PARAMETERS USED IN ‘UNIT’
CORRESPONDING JCL
FUNCTION PARAMETERS AND
SUBPARAMETER
Specification of device via address UNIT=device-address
Specification of device by model UNIT=device-type
type
Specification of device as part of a UNIT=group-name
group
Specification of device used by a UNIT=AFF
previous job step
Deferring the mounting of a tape UNIT=(device.defer)
device, until it is ready to be used
147
SYNTAX
UNIT=device-address
UNIT=device-type
UNIT=device-group-name
UNIT=AFF=prior-ddname
UNIT=(device,DEFER)
148
SPECIFICATION OF DEVICE ADDRESS
EXAMPLE
//JOB1 JOB A123,‘JAI’
//STEP1 EXEC PROGRAM1
//DATA1 DD DSN=FILE1,
// UNIT=A04
A dataset called FILE1, which resides on a device identified by its
hardware address A04, is accessed.
Unit parameter
149
SPECIFICATION OF DEVICE TYPE
• A device type is identified by the model number assigned to that
device by IBM.
• In order to code the device type on the UNIT parameter, one
needs to know the devices that are being used by the installation.
EXAMPLE:
//JOB1 JOB A123,‘JAI’
//STEP1 EXEC PROGRAM2
//DATA1 DD DSN=FILE2,
// UNIT=3380.
A dataset called FILE2, which resides on a 3380 disk unit, is
accessed.
Unit parameter
150
SPECIFICATION OF DEVICE GROUP
Unit parameter
151
EXAMPLE :
A data set called FILE3 resides on any of the devices which are
grouped under the symbolic name SYSDA.
UNIT parameter
152
CLASSROOM EXERCISE
153
‘AFF’ SUB-PARAMETER
• The AFF subparameter can be used to reference a device,
specified in a prior DD statement. AFF stands for affinity.
• This kind of specification results in unit affinity, that is same
unit is reused.
SYNTAX
//ddname1 DD UNIT=TAPE
//ddname2 DD UNIT=AFF=ddname1
ddname1 is the name of the DD statement in which the device for
the UNIT parameter was originally specified .
ddname2 is the name of the DD statement in which the AFF
parameter is used to reference the prior DD statement.
154
EXAMPLE 1 :
UNIT parameter
155
‘DEFER’ SUB-PARAMETER
UNIT parameter
156
SYNTAX
//ddname DD UNIT=(device,,DEFER)
The extra comma in the middle is used to specify the device count
subparameter.
157
EXAMPLE :
This request will be issued by the system at the time that JOB1 is
executed and PROGRAM1 requires access to DATA1.
158
SESSION -- VI
159
OBJECTIVES
To understand
• The following parameters and their sub-parameters coded on
the DD statement.
VOL
SPACE
DCB
To interpret the examples using the above parameters and their
sub-parameters.
160
‘VOL’ PARAMETER
INTRODUCTION
161
‘VOL’ PARAMETER (Contd..)
162
CORRESPONDING JCL PARAMETERS
FUNCTION SUBPARAMETERS
CODED ON THE VOL
STATEMENT.
Specification of serial SER
number
Referencing VOL REF
specification
Allowing acces to volume by This is the default, unless
all users coded otherwise.
Inhibiting dismounting of PRIVATE
volume by single user
Specification of sequence in SEQ
which volumes are to be
mounted.
163
TYPES OF LABELS
VOLUME LABEL
164
TYPES OF VOLUMES
PRIVATE
These are accessible to a single user only. Tapes are always private.
PUBLIC
These are accessible to all users.
165
‘SER’ SUB-PARAMETER
SYNTAX
VOL=SER=serial number.
Or
VOL=SER=(serial number1, serial number2)
Vol parameter
166
EXAMPLE :
167
‘REF’ SUB-PARAMETER
SYNTAX
VOL=REF=referback
Vol parameter
168
EXAMPLE :
169
‘PRIVATE’ SUB-PARAMETER
SYNTAX
VOL=PRIVATE
EXAMPLE :
//JOB1 JOB A123,‘VENU’
//STEP1 EXEC PGM=PROGRAM1
//NAME1 DD DSN=DATA1,
// VOL=(PRIVATE,,,,SER=23456)
Vol parameter
170
‘RETAIN’ SUB-PARAMETER
SYNTAX
VOL=(,RETAIN)
Or
VOL=(,RETAIN,...)
Vol parameter
171
EXAMPLE :
172
‘SEQ’ (SEQUENCE) SUB-PARAMETER
SYNTAX
VOL=(, ,sequence-number)
Or
VOL=(, ,sequence-number,...)
Vol parameter
173
EXAMPLE :
//JOB1 JOB A123,‘VENU’
//STEP1 EXEC PGM=PROGRAM1
//NAME1 DD DSN=DATA1,
// VOL=SER=HUGE
//STEP2 EXEC PGM=PROGRAM2
//NAME2 DD DSN=DATA2
// VOL=(, ,3,,SER=A123,A124,A125,A126,A127)
STEP1 executes PROGRAM1 and the dataset called DATA1 is
accessed on the volume whose serial number is HUGE.Since no
sequence no. is supplied at position 3, processing starts at volume 1.
In STEP2 the VOL parameter is used to specify that processing
should start at volume 3 of a multivolume dataset DATA2.
174
CLASSROOM EXERCISE
Write a JCL where job name is JOB1 and two programs P1 and P2
175
‘SPACE’ AND ‘DCB’ PARAMETERS
176
‘SPACE’ PARAMETER
177
SYNTAX
SPACE=(CYL(primary,secondary,directory),
RLSE,CONTIG,MXIG,ROUND)
OR
SPACE=(TRK(primary,secondary,directory),
RLSE,CONTIG,MXIG,ROUND)
OR
SPACE=(blk(primary,secondary,directory),
RLSE,CONTIG,MXIG,ROUND)
178
‘TRK’ SUB-PARAMETER
179
‘CYL’ SUB-PARAMETER
• The CYL subparameter is used to allocate space in terms of
no of cylinders.
EXAMPLE :
180
REQUESTING ‘SPACE’ IN BLOCKS
• Space can also be requested in terms of blocks. Blocksize is
independent of the device type.
EXAMPLE :
//JOB1 JOB A123,‘JAI’
//STEP1 EXEC PGM=PROGRAM1
//DATA1 DD DSN=FILE1,
// UNIT=3390,
// SPACE=(2400,1000)
Here the space allocated is 1000 blocks having block size of
2400 bytes.
181
PRIMARY AND SECONDARY ‘SPACE’
ALLOCATION
• Primary space is the no of bytes that you expect the dataset will
require for storage.
182
EXAMPLE :
183
‘DIRECTORY’ SUB-PARAMETER
SPACE parameter
184
EXAMPLE :
185
‘RLSE’ SUB-PARAMETER
SPACE parameter
186
EXAMPLE :
187
CLASSROOM EXERCISE
secondary space of 30 tracks. Ensure that at the end of the job the
188
‘CONTG’ SUB-PARAMETER
• The CONTG subparameter is used to specify that only
contiguous space should be allocated to the data set.
• This parameter applies only to primary space allocations.
EXAMPLE :
//JOB1 JOB A123,‘JAI’
//STEP1 EXEC PGM=PROGRAM1
//DATA1 DD DSN=FILE1,
// UNIT=3390,
// SPACE=(TRK, 200, ,CONTG)
The extra comma between the primary specification and the
CONTG parameter is for the RLSE parameter.
SPACE param
189
‘MXIG’ SUB-PARAMETER
• The MXIG subparameter is used to specify that space requested
should be allocated on the largest contiguous area of space
available on the volume
EXAMPLE :
//JOB1 JOB A123,‘JAI’
//STEP1 EXEC PGM=PROGRAM1
//DATA1 DD DSN=FILE1,
// UNIT=3390,
// SPACE=(TRK, 700,RLSE,,MXIG)
700 tracks of primary space is requested on a 3390 disk in an area
where 700 or more tracks of contiguous space is available.
SPACE parameter
190
‘ROUND’ SUB-PARAMETER
• The use of this subparameter results in space being allocated as
the entire cylinder instead of just portions of it.
191
EXAMPLE :
50 blocks of 500 bytes are requested as storage space and the round
subparameter results in space being rounded to the nearest cylinder.
SPACE parameter
192
‘DCB’ PARAMETER
• The DCB parameter let’s you specify file characteristics that are
stored in the file’s Data Control Block.
• For existing data sets the information is retrieved from the data
set label.
193
• The DCB parameter has four sub-parameters
SYNTAX :
DCB=(DSORG=xx,RECFM=format,
LRECL=length,BLKSIZE=block size)
194
‘DSORG’ SUB-PARAMETER
EXAMPLE : DCB=(DSORG=PS)
Specifies a sequential data set.
195
‘RECFM’ SUB-PARAMETER
F Fixed length,unblocked
FB Fixed length,blocked
V Variable length,unblocked
VB Variable length,blocked
U Undefined
DCB parameter
196
EXAMPLE 1 :
197
‘LRECL’ PARAMETER
SYNTAX
LRECL=number
Where number is the length in decimal digits.
DCB parameter
198
EXAMPLE :
DCB parameter
199
‘BLKSIZE’ PARAMETER
200
EXAMPLE :
DCB parameter
201
‘BUFNO’ PARAMETER
• The BUFNO parameter is used to specify the number of buffers
to be allocated to virtual storage for the dataset.
SYNTAX
BUFNO=number
EXAMPLE 1:
//JOB1 JOB A123,‘JAI’
//STEP1 EXEC PGM=PROGRAM1
//DATA1 DD DSN=FILE1,
// UNIT=3390,
// DCB=(RECFM=FB,LRECL=80,
// BLKSIZE=1600,
// BUFNO=40) DCB parameter
202
CLASSROOM EXERCISE
203
SESSION -- VII
204
OBJECTIVES
To understand
• The function of DUMMY and Concatenated data sets
• The function of special DD statements like SYSOUT, SYSIN
SYSUDUMP, SYSABEND
• The use of DLM, DEST, HOLD, OUTLIM parameters coded
on the DD statement.
• Importance and usage of Procedures.
• Use of symbolic parameters in Procedures
• The concept of Generation Data Groups
205
CODING DATA SETS AND I/O ON THE DD
STATEMENT
Types of data sets are
• Dummy
• Concatenated
206
‘DUMMY’ PARAMETER
• The Dummy parameter is coded on the DD statement to test the
execution of a program without actually reading or writing to a
data set.
Position In JCL :
207
EXAMPLE 1 :
//JOB1 JOB A123,‘JAI’
//STEP1 EXEC PGM=TEST1
//DATA1 DD DUMMY
EXAMPLE 2 :
208
CONCATENATING DATASETS
• A dataset can be concatenated and perceived as one file by the
operating system by coding each applicable dataset name one after
the other.
EXAMPLE 1 :
209
‘SYSUDUMP’ DD STATEMENT
• Sysudump is coded in the name field of the DD statement.
EXAMPLE 1 :
210
‘SYSABEND’ DD STATEMENT
• SYSABEND is coded in the name field of the DD statement.
• Used to obtain a dump of the contents of various registers and
variables in case of abnormal termination of the job ( on an output
device ).
• SYSTEM AREA, at the time of abnormal termination will also
be written to the output dataset.
EXAMPLE 1 :
//JOB1 JOB A123,‘JAI’
//STEP1 EXEC PGM=PROGRAM1
//SYSABEND DD SYSOUT=A.
211
‘SYSIN’ DD STATEMENT
• SYSIN is conventional DD name assigned to input data streams
which is the data entered when the job is submitted.
POSITION IN A JCL :
// Name Operation Parameters Comments
212
EXAMPLE 1 :
//JOB1 JOB A123,‘JAI’
//STEP1 EXEC PGM=PROGRAM1
//SYSIN DD *
<........... lines of data..................>
/*
EXAMPLE 2 :
//JOB1 JOB A123,‘JAI’
//STEP1 EXEC PGM=PROGRAM1
//SYSIN DD DATA
<................ lines of data................>
/*
In the second e.g. the use of DATA allows us to use special
characters // and /* in the data segment.
213
‘DLM’ PARAMETER
• The DLM parameter specifies the delimiting character that is to
be used to mark the end of the input data stream.
EXAMPLE :
//JOB1 JOB A123,’JAI’
//STEP1 EXEC PGM=PROGRAM1
//SYSIN DD DATA,DLM=@@
<................... lines of data...................>
/*
@@
Here the delimiter is‘@@’ and not ‘/*’ which is also a part of the
input data stream.
214
‘DEST’ PARAMETER
POSITION IN JCL
215
SYNTAX
DEST=RMTxxxx
Or
DEST=RMxxxx
Or
DEST=Rxxxx
Or
DEST=Uhhh
Or
DEST=Nxxxx
Or Contd.......
216
SYNTAX ( Contd..)
DEST=NnnnRyy
Or
DEST=LOCAL
217
EXAMPLE 1 :
218
EXAMPLE 2 :
219
‘HOLD’ PARAMETER
• Hold parameter is used to specify whether the output is to be
printed immediately or held until further notice.
POSITION IN JCL
SYNTAX
HOLD=YES/NO
220
EXAMPLE :
221
‘OUTLIM’ PARAMETER
• The OUTLIM parameter is used to limit the number of lines
that are output to the destination specified in the SYSOUT.
POSITION IN JCL
222
EXAMPLE 1 :
223
224
JCL PROCEDURE
Cataloged procedures
or
In-stream procedures
225
IN-STREAM PROCEDURES
226
EXAMPLE :
227
CATALOGED PROCEDURES
228
EXAMPLE 1 :
//CATPRO PROC
//STEP1 EXEC PGM=OUT1
//DATA1 DD DSN=FILE1,
// DISP=SHR
//STEP2 EXEC PGM=OUT2
//DATA2 DD DSN=FILE2,
// DISP=SHR
229
Execution Of The Procedure :
230
OVERRIDING PARAMETERS IN
PROCEDURES
• Used to override the parameters of a Procedure for the duration of
a job, without actually changing the contents of the original
procedure.
SYNTAX
231
EXAMPLE
//PROC1 PROC
//STEP1 EXEC PGM=PROGRAM1
//DD1 DD DSN=FILE1,DISP=SHR
// STEP2 EXEC PGM=PROGRAM2
//DD2 DD DSN=FILE2,DISP=SHR
232
SYMBOLIC PARAMETERS
233
SPECIFYING SYMBOLIC PARAMETER VALUES
234
ASSIGNING DEFAULT VALUES TO SYMBOLIC
PARAMETERS
To assign a default value to a symbolic parameter , you define it on
the procedure’s PROC statement.
EXAMPLE :
//NEWPRO PROC STAT=SHR
//STEP1 EXEC PGM=UVW
//DATA1 DD DSN=TRNG.NTP.COB(DATFILE),
DISP=&STAT
235
EXAMPLE :
Contd...
236
If you invoke the previous procedure as
//DATA1 DD DSN=NEWFILE1,
// DISP=SHR,UNIT=3380,
// SPACE=(CYL(5,10)),
// DCB=(RECFM=FB)
Contd..
237
Similarly in the previous procedure,if you want to supply different
values to the DSN and DISP parameters and want the other
parameters to take the default values,then you invoke the
procedure as :
//DATA1 DD DSN=MYFILE,
// DISP=OLD,UNIT=3390,
// SPACE=(CYL,(5,10)),
// DCB=(RECFM=FB)
238
239
THE CONCEPT OF GENERATION DATA
GROUPS (GDGs)
Contd...
240
THE CONCEPT OF GENERATION DATA
GROUPS (Contd..)
241
SESSION -- VIII
242
OBJECTIVES
To understand
• The necessity of Utilities
• Usage of following IBM Utilities
IEBGENER IEBCOPY
IEHPROGM IEBCOMPR
IEFBR14 SORT
MERGE
243
244
IBM UTILITIES
245
CLASSES OF IBM UTILITIES
246
CLASSES OF IBM UTILITIES
247
CLASSES OF IBM UTILITIES
248
FREQUENTLY REQUIRED FUNCTIONS
249
• Generate generation data groups
250
JCL REQUIRED TO EXECUTE THE UTILITIES
251
SOME IMPORTANT UTILITIES
• IEBGENER
• IEBCOPY
• IEHPROGM
• IEBCOMPR
• IEFBR14
• DFSORT
• MERGE
252
IEBGENER
253
CORRESPONDING JCL
254
IEBCOPY
• Copy Partitioned Data Sets
255
CORRESPONDING JCL
256
• For loading and unloading the following have to be coded :
//SYSIN DD *
COPY INDD=SYSUT1,
OUTDD=SYSUT2
/*
//
//SYSIN DD *
COPY INDD=SYSUT1,
OUTDD=SYSUT1
/*
//
257
• To include the members to a PDS the input (SYSUT1) and
output (SYSUT2) data set names will be the same and the
following have to be coded :
//SYSIN DD *
COPY INDD=SYSUT1,
OUTDD=SYSUT2
SELECT MEMBER = ( mem1, mem2,...)
/*
//
258
IEHPROGM
259
CORRESPONDING JCL
260
CATALOGING A DATA SET
SYNTAX :
CATLG DSN=data-set-name
VOL=device-name=volume-number.
261
UNCATALOGING A DATA SET
//SYSIN DD *
UNCATLG DSN=data-set-name
/*
//
262
RENAMING THE DATA SET
//SYSIN DD *
RENAME DSN=data-set-name,
VOL=device-name=volume=number
NEWNAME=new-name
/*
//
263
IEBCOMPR
• If the two data sets are identical then zero will be returned upon
successful completion of the job.
• If the data sets are not identical then a condition code of 8 will be
returned.
• The data sets that are compared must have same record length
and format, however block size need not be the same.
264
CORRESPONDING JCL
265
IEFBR14
266
EXAMPLE 1:
267
EXAMPLE 2:
268
DFSORT
269
CORRESPONDING JCL
//JOB1 JOB Accounting-inform..., programmer-name,
// Keyword-parameters
//STEPNAME EXEC PGM=DFSORT
//STEPLIB DD
//* Defines the library containing the SORT program. If it is in a
//* system library, this statement may be omitted.
//SYSPRINT DD
//* Defines the message data set
//SORTIN DD
//* Defines the INPUT data set
(contd...)
270
//SORTWKNN DD
//SORTOUT DD
//SYSIN DD *
271
EXAMPLE 1 :
//JOB1 JOB (A123).‘JAI’
//STEP1 EXEC PGM=DFSORT
//SYSOUT DD SYSOUT=A
//SORTIN DD DSN=PROJECT1.JCL, DISP=SHR
//SORTWK01 DD UNIT=SYSDA,
// SPACE=(CYL,(2,1),RLSE)
//SORTOUT DD DSN=PROJECT1.JCL,
// DISP=(NEW,CATLG,DELETE),
// UNIT=UNIT1,
// SPACE=(CYL,(2,1),RLSE)
// DCB=(RECFM=FB,
// LRECL=80,BLKSIZE=800)
//SYSIN DD *
SORT FIELDS=(2,6,D,CH)
/*
//
272
EXAMPLE 2 :
//JOB1 JOB (A123),‘JAI’
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=A
//SORTIN1 DD DSN=PROJECT.DATA1, DISP=SHR
//SORTIN2 DD DSN=PROJECT.DATA2, DISP=SHR
//SORTIN3 DD DSN=PROJECT.DATA3, DISP=SHR
//OUTFILE DD DSN=PROJECT1.MRGFILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=UNIT1,SPACE=(CYL,(2,1),RLSE)
// DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
MERGE FIELDS=(2,6,A,CH)
/*
//
273