Académique Documents
Professionnel Documents
Culture Documents
DEFINITION:
JCL is an interface between application program and operating system
1.
2.
3.
4.
1-2
3-10
11
Identifie Name
r field
field
Space
12-15
16
Operati Space
on field
17-71
72-80
Paramet Comme
er field nt Field
JCL Statements:
In JCL we have 3 statements. They are..
1. Job Statement
2. EXEC Statement
3. DD Statement
1. JOB STATEMENT:
a) Specifies the starting of the job
b) We can write only one job statement in one JCL
c) In job statement we have both positional and keyword parameters
i.
Positional Parameters:
In job statement we have two positional parameters. They are..
a. ACCOUNTING INFORMATION
b. PROGRAMMER NAME
1) These two are mainly used for the billing purpose to include the
bill amount and billers name
2) These two are also used in job statement for writing job related
description
1. Positional parameters always follow the order
2. If any one of the above parameter is absent we have to separate with
comma(,)
3. If two parameters are absent ignore the field
4. Positional parameters in job statement are optional
ii. Keyword Parameters:
The list of keyword parameters existed in a job statement are as
follows
1. CLASS
2. PRTY
3. MSG CLASS
4. MSG LEVEL
5. TIME
6. REGION
7. RESTART
8. ADDRSPC
9. TYPRUN
10.NOTIFY
1. CLASS:
1.
2.
3.
4.
2. PRTY:
When two jobs CLASS names are same based on given priority the is
executed
VALUE
4. MSGLEVEL:
It is used to print the level of output description
Syntax: MSGLEVEL
(N, M)
6. REGION:
Specifies maximum amount of memory require for job execution
Syntax: K or
M
The Maximum memory for REGION is 4M
7. RESTART:
1. Using RESTART parameter we can bypass any no of steps only from
beginning
2. Using RESTART we cant bypass the steps randomly
EX: s1, s2, s3, s4, s5, s6 are the steps
RESTART =s2
In the above example execution start from step2 onwards
8. TYPRUN:
1. It specifies the execution status of a job
2. Using TYPRUN we can also check the JCL code i.e. Syntax check
3. TYPRUN having different values as follows
SYNTAX:
TYPRUN = SCAN It checks only syntax errors and wont execute the job
TYPRUN = COPY It copies the use code and JCL on to the spool
TYPRUN = HOLD It checks only syntax errors and execute the job
TYPRUN = HOLD is default
9. ADDRSPC:
a. It specifies where the job is executing
2. EXEC STATEMENT:
EXEC statement specifies starting of a step. Max 255 EXEC statements can
be written in one JCL
a. Positional Parameters:
1. PGM - Specifies the program name or load module
2. PROC Specifies the procedure
Any one of the above parameters is required for the job execution
b. Keyword Parameters:
1. TIME
2. REGION
3. PARM
4. COND
1. PARM:
By using PARM parameter we can pass max 100 characters of data to the
program
PARM is available character which contain both text & length fields
2. COND:
By using COND parameter we can execute or bypass any no of steps in a
job
In COND parameter it always take previous step return code only i.e.
MAXCC
If the given condition is satisfied it bypass the current step from execution if
not the current step is executed
COND is opposite to the IF statement
Syntax: COND = (Status Code, Operands, Step Name)
S TATU S C O D E
0 - 4059
0 S u c ce ssfu l
Exe cu tio n
4 Wa rn in g s
8 - E rror
1 2 - S e v ere
Erro r
1 6 - Fata l
Erro r
O P E RA N D S
Example:
G re a te r
T ha n (> )
Le ss
T ha n (< )
G re a te r
T ha n E q u a l
To (> = )
Le ss Th a n
Equal
To (< = )
Equal
To (= )
Not Equal
To (!= )
S1
MAXXCC = 4
S2
STEP NAM E
S p e cifi e s
the n a m e
o f th e ste p
S3
S4
S5
Because of given condition step 2 will be bypassed from execution.
In COND we have 2 special values. They are.
a. COND = ONLY If it is coded then the current step is executed if and
only if the previous step is abended
b. COND = EVEN If it is coded then irrespective of previous step
execution it process the current step
3. DD STATEMENT:
DD statement specifies the data sets using in a JCL
MAX 3273 DD statements can be written in one JCL
1. Positional Parameters:
a. * (ALL) It is used in control statement and also used in various DD
statements
EX: //SYSIN DD *
b. Dummy it is mainly used to bypass the input data
EX: //SYSIN DD DUMMY
c. Data It is mainly used to pass the JCL lines
EX: //SYSIN DD DATA
2. Keyword Parameters:
a. DSN
b. DISP
c. SPACE
d. DCB
e. VOL=SER
f. UNIT
a. DSN (Data Set Name):
The max length of DSN is 44 characters and for every 8 characters there will
be a qualifier and max 5 qualifiers are allowed
1st qualifier should be USER ID. Possible values are a-z, 0-9, national
characters like #, @, $.
b. DISP (Disposition):
Used to specify status for the data sets
Syntax: (Status, Normal Disposition, Abnormal Disposition)
NORMAL
D IS P O S IT IO N
S TAT U S
N E W - S p e c ifi e s
n e w ly c re a tin g
d a ta s e t
O L D - S p e c ifi e s
a n e x is tin g d a ta
set
M O D (M o d ify ) a ls o s p e c ifi e s a n
e x is tin g d a ta s e t
S H R (S H A R E ) th e d a ta s e t is
s h a ra b le in
e n v iro n m e n t
C ATA LO G S p e c ifi e s th e
s to rin g th e d a ta
set nam e
p e rm a n e n tly in
th e v o lu m e
U N C ATA LO G U s e d to h id e th e
d a ta s e t
DELETE D e le te s th e d a ta
s e t fro m D A S D
K E E P - C re a tin g
te m p o ra ry d a ta
s e ts .
PA SS - C re a tin g
te m p o ra ry d a ta
s e ts . T h e d a ta
c a n b e u s e d in
n e x t le v e ls a ls o
ABNORM AL
D IS P O S IT IO N
C ATA LO G
U N C ATA LO G
D ELETE
KEEP
c. SPACE:
SPACE= (space unit, (primary, secondary, directory block), rlse)
Directory Block is required only for PDS. For PS its 0.
RLSE (RELEASE) It releases the unused secondary quantity from the
resource
D. DCB (Data Control Block) It specifies attributes of a data set
Syntax: DCB = (recfm = fb, lrecl = value, Belsize = multiples of lrecl only)
RECFM
LRECL
SPECIAL DD STATEMENTS:
1.
2.
3.
4.
5.
6.
SYSOUT
SYSPRINT
SYSIN
STEPLIB
JOBLIB
JCLLIB
UTILITIES
Utilities are IBM supplied programs which are already coded, compiled and
executed to perform a specific functionality
All utilities are pre-defined programs
Utilities are mainly divided into two types. They are..
1. Data Set Utilities
2. System Utilities
The list of utilities available in JCL are as follows
1. IEBCOPY
2. IEBCOMPR
3. IEBGENER
4. IEBEDIT
5. IEBUPDTE
6. IEBPTPCH
7. IEHLIST
8. IEHPROGM
9. IEFBR14
10.IDCAMS
11.ICEMAN
12.SORT
All data set utilities always start with prefix IEB
All system utilities always start with prefix IEH
1. IEFBR14
IEFBR14 is called a dummy utility, mainly used for creation of non-vsam data
sets
We can also delete the non-vsam data sets using this utility
SPACE=(TRK,(10,10),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
//SYSIN DD *
/*
EX2. Creation of PDS file using IEFBR14
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=MATE05.GRP.PDS,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(10,10,1),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
//SYSIN DD *
/*
EX3. Deletion of PDS file using IEFBR14
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=MATE05.GRP.PDS,DISP=(OLD,DELETE,DELETE),
//
SPACE=(TRK,(10,10,1),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
//SYSIN DD *
/*
EX4. Deletion of PS file using IEFBR14
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=MATE05.GRP.PS,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(10,10),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
//SYSIN DD *
/*
2. IDCAMS
IDCAMS is a VSAM utility it also creates non-vsam files
EX1. Creation of PS file using IDCAMS
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=MATE05.GRP.PS,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(10,10),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
//SYSIN DD *
/*
EX. Creation of PDS file using IDCAMS
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=MATE05.GRP.PDS,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(10,10,1),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
//SYSIN DD *
/*
3. IEBCOPY
IEBCOPY works on the PDS file
By using IEBCOPY we can copy the members from one PDS to another PDS
Using IEBCOBY we can also bypass or exclude the members from copy and
also we can rename the existing members
EX1. Copy all members from PDS to PDS
//MATE05AB JOB NOTIFY=&SYSUID
M1
M1
M2
M2
//SYSPRINT DD SYSOUT=*
M3
M3
//DD1 DD DSN=MATE05.GRP.PDS,DISP=SHR
//DD2 DD DSN=MATE05.GRP.PDS1,DISP=SHR
//SYSIN DD *
COPY INDD=DD1,OUTDD=DD2
//SYSOUT DD SYSOUT=*
/*
M1
M2
M3
M1
M1
A1
M2
A2
M3
X1
//DD2 DD DSN=MATE05.GRP.PDS1,DISP=SHR
//SYSIN DD *
COPY INDD=DD1,OUTDD=DD2
SELECT MEMBER=((M1,A1,R),(M2,A2,R))
//SYSOUT DD SYSOUT=*
/*
EX4. Exclude the members
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=MATE05.GRP.PDS,DISP=SHR
//DD2 DD DSN=MATE05.GRP.PDS1,DISP=SHR
//SYSIN DD *
COPY INDD=DD1,OUTDD=DD2
EXCLUDE MEMBER=(M1,M2)
//SYSOUT DD SYSOUT=*
/*
M1
M2
M3
M3
M4
//SYSOUT DD SYSOUT=*
/*
EX2. Comparing PDS files
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBCOMPR
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PDS,DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PDS1,DISP=SHR
//SYSIN DD *
COMPARE TYPORG=PO
//SYSOUT DD SYSOUT=*
/*
5. IEBGENER
Mainly used for taking the backup of data
IEBGENER works only on PS files
The possibilities in IEBGENER are as follows
PS
PS
PS
PDS (MEMBER)
PDS (MEMBER)
PS
PDS (MEMBER)
PDS (MEMBER)
EX1. PS PS
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PS1,DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PS2,DISP=SHR
//SYSIN DD *
//SYSOUT DD SYSOUT=*
/*
EX2. PS PDS (MEMBER)
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PS,DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PDS(M1),DISP=SHR
//SYSIN DD *
//SYSOUT DD SYSOUT=*
/*
EX3. PDS (MEMBER) PS
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PDS(M1),DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PS2,DISP=SHR
//SYSIN DD *
//SYSOUT DD SYSOUT=*
/*
EX4. PDS (MEMBER) - PDS (MEMBER)
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PDS(M1),DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PDS(M2),DISP=SHR
//SYSIN DD *
//SYSOUT DD SYSOUT=*
/*
M3
//SYSUT1 DD DSN=MATE05.GRP.PDS1(M2),DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PS2,DISP=SHR
//SYSIN DD *
GENERATE MAXFLDS=2
RECORD FIELD=(4,1,,1),FIELD=(5,6,,6)
//SYSOUT DD SYSOUT=*
/*
INPUT:
1001 RAMU
1002 KUMA
R
1003 RAVI
2500
0
3200
0
4200
0
0010
0100
1000
OUTPUT:
1001 RAMU
1002 KUMAR
1003 RAVI
EX7. Inserting literals using MAXLITS MAX LITERALS
Using MAXLITS we can insert any no of literals in output file
EX6.
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PDS1(M2),DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PS2,DISP=SHR
//SYSIN DD *
GENERATE MAXFLDS=3,MAXLITS=1
RECORD FIELD=(4,1,,1),FIELD=(1,*,,5), FIELD=(5,6,,6)
//SYSOUT DD SYSOUT=*
/*
PS3
PS
1
PS
2
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PS1,DISP=SHR
//
DD DSN=MATE05.GRP.PS2,DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PS3,DISP=SHR
//SYSIN DD *
//SYSOUT DD SYSOUT=*
/*
6. IEBEDIT
Using IEBEDIT utility we can process any steps existed in a job
In IEBEDIT we have two possibilities. They are.
1. INCLUDE
2. EXCLUDE
By using INTRDR Internal Reader, we can process any required steps in a job
EX1.
In one PDS member
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=MATE05.GRP.PS,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(10,10),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
//SYSIN DD *
//STEP2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=MATE05.GRP.PS,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(10,10),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
//SYSIN DD *
//STEP3 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PDS(M1),DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PS2,DISP=SHR
//SYSIN DD *
//SYSOUT DD SYSOUT=*
//STEP4 EXEC PGM=IEBCOMPR
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PDS,DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PDS1,DISP=SHR
//SYSIN DD *
COMPARE TYPORG=PS
//SYSOUT DD SYSOUT=*
Now in a member of your JCL
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBEDIT
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PDS(M2),DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSIN DD *
EDIT TYPE=EXCLUDE,STEPNAME=(STEP1,STEP3)
//SYSOUT DD SYSOUT=*
/*
EX2.
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBEDIT
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PDS(M2),DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSIN DD *
EDIT TYPE=INCLUDE,STEPNAME=(STEP1,STEP3)
//SYSOUT DD SYSOUT=*
/*
7. IEBUPDTE
By using IEBUPDTE we can change any record data existed in a member of
PDS by copying the address of the particular record
By using IEBPTPCH IEBPUNCH utility we can add max two title items to
the output fields
Using record field we can select any column data from the input file
SYNTAX:
PRINT TYPORG = PS, MAXFLDS = VALUE
TITLE ITEM = (INPUT TEXT,LOCATION IN OUTPUT)
TITLE ITEM = (INPUT TEXT,LOCATION IN OUTPUT)
EX
CASE1. Printing the output on to the spool
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PS1,DISP=SHR
//SYSUT2 DD SYSOUT=*
//SYSIN DD *
PRINT TYPORG=PS,MAXFLDS=2
TITLE ITEM=('EMPLOYEE DETAILS',30)
TITLE ITEM=('ENUM ENAME ',1)
RECORD FIELD=(4,1,,25),FIELD=(5,6,,30)
//SYSOUT DD SYSOUT=*
/*
CASE2. Printing data into an output file
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PS1,DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PS2,DISP=SHR
//SYSIN DD *
PRINT TYPORG=PS,MAXFLDS=2
TITLE ITEM=('EMPLOYEE DETAILS',30)
TITLE ITEM=('ENUM ENAME ',1)
RECORD FIELD=(4,1,,25),FIELD=(5,6,,30)
//SYSOUT DD SYSOUT=*
/*
SORT AND ICEMAN
By using SORT we can perform only sort operation but by using ICEMAN
we can perform sort and merge
SYNTAX:
SORTFIELDS=(LOCATIONINPUT,LENGTH,FORMAT,SORTSE
QUENCE)
Sort sequence = A Ascending
D Descending
EX1. SIMPLE SORT
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=MATE05.GRP.PS1,DISP=SHR
//SORTOUT DD DSN=MATE05.GRP.PS2,DISP=SHR
//SYSIN DD *
SORT FIELDS=(1,5,CH,D)
//SYSOUT DD SYSOUT=*
/*
EX2. Eliminating the duplications existing in SORT field
SYNTAX1.
LISTVTOC DSNAME=MATE05.GRP.PDS,VOL=SYSDA=DEVMA0
//SYSOUT DD SYSOUT=*
/*
b. LISTPDS
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEHLIST
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=OLD,VOL=SER=DEVMA0,UNIT=3390
//SYSIN DD *
LISTPDC DSNAME=MATE05.GRP.PDS,VOL=SYSDA=DEVMA0
//SYSOUT DD SYSOUT=*
/*
2. IEHPROGM
Using this utility we can DELETE the member of a PDS and also we can
RENAME the existing member of a PDS
Using this we can also CATALOG and UNCATALOG the data set
EX1. DELETE MEMBER
PDSOUTPUT
//MATE05AB JOB NOTIFY=&SYSUID
PDS INPUT
A1
A1
G1
//SYSOUT DD SYSOUT=*
/*
EX1. RENAMING THE MEMBER
PDSOUTPUT
PDS INPUT
A1
A1
PROCEDURES
PROCEDURE:
Is a step of JCL statements Using procedure we can reduce the program code
Using procedures we can write step in one procedure and we can execute them
anytime whenever we require
Each and every procedure will be identified with the prefix
//PROCNAME PROC
//STEP1
//PEND
PROC specifies the procedure where PEND specifies the end of procedure
EX
//MATE02AB JOB NOTIFY=&SYSUID
//PROC1 PROC
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PDS1(M2),DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PS2,DISP=SHR
GENERATE MAXFLDS=3
RECORD FIELD=(4,6,,1),FIELD=(5,11,,6),FIELD=(4,1,,12)
// PEND
//PROC2 PROC
//STEP2 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PDS(M1),DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PS1,DISP=SHR
// PEND
//PROC3 PROC
SPACE=(TRK,(10,10),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
//SYSIN DD *
/*
CODE IN MATE02.GRP.PDS(M2)
//M2 PROC
//STEP2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=MATE05.GRP.PDS,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(10,10,1),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
//SYSIN DD *
/*
CODE IN MATE02.GRP.PDS(M3)
//M3 PROC
//STEP3 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=MATE05.GRP.PDS,DISP=SHR
//DD2 DD DSN=MATE05.GRP.PDS1,DISP=SHR
//SYSIN DD *
COPY INDD=DD1,OUTDD=DD2
SELECT MEMBER=(M1,M2)
//SYSOUT DD SYSOUT=*
/*
CODE IN MATE02.GRP.PDS(M4)
//M4 PROC
//STEP4 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PDS1(M2),DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PS2,DISP=SHR
//SYSIN DD *
GENERATE MAXFLDS=2
RECORD FIELD=(4,1,,1),FIELD=(5,6,,6)
//SYSOUT DD SYSOUT=*
/*
CODE IN MATE02.GRP.PDS(M5)
//M5 PROC
//STEP5 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PS1,DISP=SHR
//
DD DSN=MATE05.GRP.PS2,DISP=SHR
//SYSUT2 DD DSN=MATE05.GRP.PS3,DISP=SHR
//SYSIN DD *
//SYSOUT DD SYSOUT=*
/*
CODE IN MATE02.GRP.PDS(M6)
//M6 PROC
//STEP1 EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PS1,DISP=SHR
//SYSUT2 DD SYSOUT=*
//SYSIN DD *
PRINT TYPORG=PS,MAXFLDS=2
TITLE ITEM=('EMPLOYEE DETAILS',30)
TITLE ITEM=('ENUM ENAME ',1)
RECORD FIELD=(4,1,,25),FIELD=(5,6,,30)
//SYSOUT DD SYSOUT=*
/*
CODE IN MATE02.GRP.JCL(CATPRO)
//MATE05AB JOB NOTIFY=&SYSUID
//JCLLIB ORDER=(MATE05.GRP.PDS1)
//STEP1 EXEC PROC=M1
/*
PROCEDURE OVERRIDING
Using Procedure Overriding we can change the parameters values at the time of
execution of a procedure
We can override both EXEC and DD statement parameters
To override the EXEC statement parameter values
PARAMETER.STEPNAME=VALUE
To override DD statement parameter values
//STEPNAME.DDNAME DD PARAMETER=VALUE
EX
//MATE05AB JOB NOTIFY=&SYSUID
//PROC3 PROC
//STEP1 EXEC PGM=IEFBR14,TIME=(5,50)
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=MATE05.GRP.PS5,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(10,10),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
// PEND
//STEP2 EXEC PROC=PROC3,TIME.STEP1=(2,20)
//STEP1.DD1 DD DSN=MATE05.GRP.PS6
//SYSOUT DD SYSOUT=*
/*
In the above example time value will be override by time=(2,20) at the same
time DSN value also override by PS6.
SYMBOLIC PARAMETERS
Symbolic parameters are the variables which can hold some values in it and the
value of symbolic parameters will be applied to the parameters whenever the
procedure is executed
Symbolic parameters are represented with a prefix &
SPACE=(TRK,(10,10),RLSE),
//
DCB=&B
//
VOL=SER=&C,UNIT=3390
//PEND
//STEP2 EXEC PROC=PROC2,A=MATE05.GRP2.PS3
//B=(RECFM=FB,LRECL=70,BLKSIZE=700),
//C=DEVMA0
//SYSOUT DD SYSOUT=*
/*
CASE2.
//MATE05AB JOB NOTIFY=&SYSUID
//PROC3 PROC
//STEP1 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=&A,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(10,10),RLSE),
//
DCB=&B
//
VOL=SER=&C,UNIT=3390
//PEND
//STEP2 EXEC PROC=PROC3
//VAL1 SET A=MATE05.GRP2.PS3
// VAL2 SET B=(RECFM=FB,LRECL=70,BLKSIZE=700),
// VAL3 SET C=DEVMA0
//SYSOUT DD SYSOUT=*
/*
REFERBACK OPERATOR
By using REFERBACK OPERATOR * we can use any previous step
parameters value into the currently running step
We cant use REFERBACK in 1st step because REFERBACK always takes
the previous step values
SYNTAX: PARAMETER=*.STEPNAME.DDNAME
EX
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=MATE05.GRP.PS7,DISP=SHR
//
SPACE=(TRK,(10,10),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
//STEP2 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATE05.GRP.PS1,DISP=SHR
//SYSUT2 DD DSN=*.STEP1.DD1,DISP=SHR
//SYSIN DD *
//SYSOUT DD SYSOUT=*
/*
1. NAME Specifies the name of a GDG which is mandatory. For every GDG
base cluster, Max length of GDG name is 35 characters
2. LIMIT(n) where n specifies the no of Generations require by the user. Max
value of n is 255
3. EMPTY or NOEMPTY
In case of EMPTY, when LIMIT is exceeded it uncatalogs all Generations and
create a New generation
In case of NOEMPTY, when LIMIT is exceeded it uncatalogs the oldest
Generation and New Generation is created.
NOEMPTY is default
4. SCRATCH or NOSCRATCH
SCRATCH will delete all uncataloged Generations
In case of NOSCRATCH , it wont delete the uncataloged Generations
NOSCRATCH is default
Step2. Creation of Modal data set
Modal data set is a PS file which is mainly used to set the properties for the
newly creating Generations
Step3. Generating Generations
Whenever user wants to generate the Generations according to the user
requirement
GDG(+2)
Day by Day Generations
GDG(+1)
Daily Generations
SPACE=(TRK,(10,10),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
/*
EX3. Generating Generations
//MATE05AB JOB NOTIFY=&SYSUID
SPACE=(TRK,(10,10),RLSE),
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
//
VOL=SER=DEVMA0,UNIT=3390
//SYSOUT DD SYSOUT=*
//SYSIN DD *
/*
Description:
In GDG + specifies newly creating GDGs
specifies an existing Generations
0 specifies Current Generations
Altering the GDG
By using ALTER command we can change the properties of GDG base
cluster
By using ALTER
1.
2.
3.
4.
EX.
//MATE05AB JOB NOTIFY=&SYSUID
DELETE GDG
By using DELETE command we can delete the GDG from catalog, while
deleting GDG we have two possible ways. They are.
1. Force
2. Purge
Force will delete all generations along with GDG base cluster
In case of Purge, it deletes all the Generations
NOTE:
It overrides the retention period and deletes the GDG
EX.
//MATE05AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *