Escolar Documentos
Profissional Documentos
Cultura Documentos
DAY 3
10/15/08 1
ER/CORP/CRS/OS02/003-3
PROCEDURES
It is a prepacked JCL.
10/15/08 2
ER/CORP/CRS/OS02/003-3
TYPE OF PROCEDURES
• In-stream procedures
Coded in the executing job
max of 15 per JOB
• Catalogued Procedure
Member of a PDS (procedure library)
max 255 steps
10/15/08 3
ER/CORP/CRS/OS02/003-3
Invoking a Procedure
// EXEC procname
// EXEC PROC=procname
eg:
//name1 EXEC MYPROC
//name1 EXEC PROC=MYPROC
10/15/08 4
ER/CORP/CRS/OS02/003-3
JCLLIB
Specifies the names of the private libraries the system is to search for:
Procedures named on any EXEC statement
JCL referenced by the INCLUDE statement (after release 4)
ex: // INCLUDE MEMBER=MYJCL
ER/CORP/CRS/OS02/003-3
PROCEDURES must not contain :
1) JOB statement
X 2) EXEC statement invoking a procedure
3) JOBLIB DD statement
4) DD * , DD DATA - In-stream data
5) /* delimiter statement
6) // Null statement
7) JES statements
8) PEND statement (for cataloged procedures)
10/15/08 6
ER/CORP/CRS/OS02/003-3
CATALOGED PROCEDURE
ER/CORP/CRS/OS02/003-3
In-stream procedure
• It must begin with a PROC statement and end with a PEND
statement
• It should be coded before the first EXEC statement invoking
the instream procedure
000700 /* ER/CORP/CRS/OS02/003-3
Cataloged procedure
• It must begin with a PROC statement and must not contain a
PEND statement
• It must be cataloged in order to access it that is it must be a
member of a PDS.
• Cataloged procedure:
ER/CORP/CRS/OS02/003-3
Questions ??
If a JCL has two an instream procedure and a cataloged procedure
with the same name which one will be executed ?
Answer :
Instream procedure will be executed 10/15/08
10
ER/CORP/CRS/OS02/003-3
Questions ??
If a JCL has two an instream procedure and a cataloged procedure
with the same name which one will be executed ?
Answer :
Cataloged procedure will be executed 10/15/08
11
ER/CORP/CRS/OS02/003-3
Questions ??
Is the JCL given below correct? Yes/No , Justify your answer ?
Restriction relieve:
Procedure can have a exec statement calling another procedure
10/15/08
12
ER/CORP/CRS/OS02/003-3
Nested Procedures
10/15/08
13
ER/CORP/CRS/OS02/003-3
Nested Procedures (examples)
000100 //INF62441 JOB (AMLAN),NOTIFY=INF6244,CLASS=A
000110 //LIB1 JCLLIB ORDER=(INF6244.JCL.SOURCE)
000111 //FSTPROC PROC
000112 //STEP1 EXEC MYPROC
000113 // PEND
000114 //SNDPROC PROC
000115 //STEP1 EXEC FSTPROC
000116 // PEND
000120 //STEP1 EXEC SNDPROC
000130 /*
• MYPROC
000200 //MYPROC PROC
000201 //STEP1 EXEC NESTPROC
000210 //STEP2 EXEC PGM=IEFBR14,COND=(0,NE)
000220 //DD1 DD DSN=&&TEMP,SPACE=(TRK,(1,1)),
000230 // DCB=(RECFM=FB,BLKSIZE=800,LRECL=80),
000231 // VOL=SER=INUSR3,
000240 // DISP=(NEW,KEEP),UNIT=SYSDA
• CALLJCL
000100 //INF62441 JOB (AMLAN),NOTIFY=INF6244,CLASS=A
000110 //LIB1 JCLLIB ORDER=(INF6244.JCL.SOURCE)
000260 //STEP1 EXEC MYPROC 10/15/08
15
ER/CORP/CRS/OS02/003-3
Identifying procedure statements in
job’s JCL listing
Identifier Identifier Meaning
For In stream for Catalogued
Procedure procedure
10/15/08
16
ER/CORP/CRS/OS02/003-3
Modifying the Procedure
SYMBOLIC PARAMETERS
10/15/08
17
ER/CORP/CRS/OS02/003-3
Symbolic Parameters
Symbolic parameters are variables used in procedures
Syntax - &Varname
Varname - 1-7 character
1) SET statement
2) EXEC PROC statement
3) PROC statement
10/15/08
18
ER/CORP/CRS/OS02/003-3
Symbolic Parameters examples ...
10/15/08
19
ER/CORP/CRS/OS02/003-3
Symbolic Parameters examples ...
10/15/08
20
ER/CORP/CRS/OS02/003-3
Question ??
10/15/08
21
ER/CORP/CRS/OS02/003-3
REFERING BACK AND MODIFYING
(examples)
10/15/08
22
ER/CORP/CRS/OS02/003-3
REFERING BACK AND MODIFYING
(examples)
000100 //INF62441 JOB (AMLAN),NOTIFY=INF6244,CLASS=A
000101 //STEP1 EXEC PGM=IEFBR14
000102 //DD1 DD DSN=INF6244.TEST.PS1,SPACE=(TRK,(1,1)),
000103 // DCB=(RECFM=FB,BLKSIZE=800,LRECL=80),VOL=SER=INUSR3,
000104 // DISP=(NEW,CATLG),UNIT=SYSDA
000105 //STEP2 EXEC PGM=IEFBR14
000106 //DD1 DD DSN=*.STEP1.DD1,SPACE=(TRK,(1,1)),
000107 // DCB=*.STEP1.DD1,VOL=SER=INUSR3,
000108
10/15/08
23
ER/CORP/CRS/OS02/003-3
Questions ??
10/15/08
24
ER/CORP/CRS/OS02/003-3
IBM UTILITY PROGRAMS
10/15/08
25
ER/CORP/CRS/OS02/003-3
UTILITY PROGRAMS
10/15/08
26
ER/CORP/CRS/OS02/003-3
GENERAL FORMAT FOR IEBXXXX
• SCRATCHES
– RENAMES
– CATALOGS
• UNCATALOGS
10/15/08
30
ER/CORP/CRS/OS02/003-3
IEHLIST PROGRAM
• LIST CATALOG
• LIST PDS
• LIST VTOC
DAY
3
10/15/08
32
ER/CORP/CRS/OS02/003-3