Professional Documents
Culture Documents
Legacy Manifram Training-3
Legacy Manifram Training-3
Legacy Manifram Training-3
Procedures
Procedure
Types of procedures
2
PROCEDURES
3
PROCEDURES
1) Cataloged procedures
4
Catalog Procedures
Set of JCL Stmt’s that are grouped together and then
recorded as a member of partitioned dataset. This
partitioned dataset can be included in the JCL with JCLLIB
stmt.
String of JCL statements defined as a member of one of the
procedure libraries, usually SYS1.PROCLIB.
Procedure referenced by the name of the member in the
cataloged library
Can be used by any number of jobs
5
In stream Procedures
6
Procedures
Proc statement
Marks the beginning of a procedure
Optional for a cataloged procedure
Required for an in stream procedure; it must appear as the
first control statement in the in stream procedure
Name is optional for cataloged procedures but required for
in stream procedures
8
Rules for Coding Procedures:
9
PEND statement
Signifies the end of a procedure
Name is optional
eg.
//SORTPROC PROC
//S1 EXEC PGM=SORT
//SORTIN DD DSN=SORTIN.DSN,
DISP=SHR
//SORTOUT DD DSN=SORTOUT.DSN,
// DISP=(NEW,CATLG)
//SORTPROC PEND
10
EXAMPLE
EXAMPLE OF A CATALOGED PROCEDURE
//SORTPROC PROC
//* THIS IS A CATALOGED PROCEDURE
//STEPSORT EXEC PGM=SORT
//SORTIN DD DSN=SORTIN.FILE, DISP=SHR
//SORTOUT DD DSN=SORTOUT.FILE,
// DISP=(,CATLG),UNIT=SYSDA, VOL=SER=VOL001,
// SPACE=(CYL, (10,2)),
// DCB=(LRECL=80, BLKSIZE=80,RECFM=F)
//SORTLIB DD DSN=SYS1.SORTLIB,
// DISP=SHR
//SYSOUT DD SYSOUT=A
//SORTPROC PEND 11
EXAMPLE
12
Example
13
Example ( Cont...)
14
Symbolic parameters
15
Symbolic parameters
16
Example
//COMPILE PROC &MEM=,&T=1
//* DEFINING THE PROC WITH SYMBOLIC
PARAMETERS
//STEP1 EXEC PGM=IKFCBL00,TIME=&T
//SYSIN DD DSN=IBM.COBOL.SOURCE(&MEM)
//*
//JOB1 JOB
//* INVOKE THE PROC
//S1 EXEC PROC=COMPILE,MEM=PROG01
//* INVOKE THE PROC
//S2 EXEC PROC=COMPILE, MEM=PROG02,T=2
17
Overriding parameters
To override a parameter on the EXEC statement, when invoking the proc, follow on the
proc statement with:
• PARAMETER.PROC STEPNAME=VALUE
EG.
DEFINING THE PROC
//PROC1 PROC
//STEP1 EXEC PGM=PROG01,PARM=`910101’
//DD1 DD DSN=DD1.DSN,DISP=OLD
//*
//STEP2 EXEC PGM=PROG02,PARM=`910101’
//DD2 DD DSN=DD2.DSN,DISP=OLD
INVOKING THE PROC
//JOB1 JOB CLASS=5
//S1 EXEC PROC=PROC1,STEP1.PARM=`910201’
18
Overriding DD statements
Recode the DD statement with the DDnames
proc Stepname.DDnames
No need to recode the entire DD statement.
Just code the changes.
If overriding more than one DD statement,
put the overriding statements in the same
order as they appear in the procedure
To add new DD statements, put them after all the
overriding statements
19
Example
//PROC1 PROC
//STEP1 EXEC PGM=PROG01
//INPUT DD DSN=INPUT.FILE,DISP=OLD
//OUTPUT DD
DSN=OUTPUT.FILE,DISP=(NEW,CATLG),
// UNIT=DISK,VOL=SER=111111,SPACE=(TRK,10),
// DCB=(LRECL=100,BLKSIZE=1000,RECFM=10)
20
Overriding DD statements
Invoke the PROC
//JOB1 JOB
//S1 EXEC PROC=PROC1
//STEP1.INPUT DD*
1234567890
ABCDEFFGHIJKLMNOPQRSTUVWXYZ
/*
//
//JOB1 JOB
//S2 EXEC PROC=PROC01
//STEP1.OUTPUT DD DUMMY,DCB=BLKSIZE=1000
//SYSUDUMP DD SYSOUT=A
21
JCL that executes In-stream Procedure
//TRG034M JOB NOTIFY=&SYSUID,CLASS=A
//*
//***********************************************************************
//* THIS JCL IS AN EXAMPLE FOR INSTREAM PROCEUDRE
//***********************************************************************
//PROC1 PROC
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=TRG034.TRAINING.INSTREAM,
// DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,SPACE=(TRK,(1,1),RLSE),
// DCB=(DSORG=PS,LRECL=80,RECFM=FB)
// PEND
//STEP2 EXEC PROC=PROC1
22
JCL to Execute(Run) a Catalog Procedure (this is not a Catalog)
23
This is Catalog Procedure
(Cataloged procedures can’t be executed directly, it needs
JCL to run, see the previous slide to run this Catalog
Procedure)
//************************************************
//* THIS JCL IS AN EXAMPLE FOR CATALOG PROCEUDRE
//************************************************
//PROC2 PROC
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=TRG034.TRAINING.CATALOG,
// DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,SPACE=(TRK,(1,1),RLSE),
// DCB=(DSORG=PS,LRECL=80,RECFM=FB)
// PEND
24
SYMBOLIC PARAMETERS
//TRG034M JOB NOTIFY=&SYSUID,CLASS=A
//*
//***********************************************************************
//* THIS JCL IS AN EXAMPLE FOR SYMBOLIC PARAMETERS
//* IN INSTREAM PROCEDURE
//***********************************************************************
//PROC1 PROC A=INSTRE
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=TRG034.TRAINING.&A,
// DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,SPACE=(TRK,(1,1),RLSE),
// DCB=(DSORG=PS,LRECL=80,RECFM=FB)
// PEND
//STEP2 EXEC PROC=PROC1,A=INSTREAM
Note: Explanation in the next slide
25
//STEP2 EXEC PROC=PROC1,A=INSTREAM
If you provide the value of ‘A’ while executing/running the
Instream procedure then this value will override the
value(default value) that was provided while creating the
proc i.e //PROC1 PROC A=INSTRE
26
Thank You
27