Professional Documents
Culture Documents
JCL-PPT-5 - Procedures
JCL-PPT-5 - Procedures
JCL-PPT-5 - Procedures
Session 5
Nagaraju Domala
SESSION OBJECTIVES
At the end of this session participants would have understood
Nagaraju Domala
Points to Cover
Categories of procedures and definitions
In stream procedures
Catalogued procedures
Syntax rules in procedures
Regular overrides of DD and EXEC statements
Symbolic overrides of DD and EXEC statements
Nagaraju Domala
Categories of procedures and definitions
PROCEDURES:
It is a prepacked JCL.
JCL needed by many different users
A JCL executed on a repetitive basis
JCL often repeated within the execution of a single job
A procedure is invoked by specifying its name in an EXEC statement.
//STEP1 EXEC INV3000 ( OR )
//STEP1 EXEC PROC=INV3000
A name is always required on a PROC statement.
The word PROC is optional.
A procedure invoking EXEC statement causes previously stored JCL
statements to be read into the job stream.
A procedure can not invoke another procedure.
Nagaraju Domala
Categories of procedures and definitions
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
Nagaraju Domala
Syntax rules in procedures
RESTRICTIONS:
THE NUMBER OF STEPS IN A PROC CANNOT EXCEED 255
THE FOLLOWING ARE NOT PERMITTED TO RESIDE IN A PROC
A JOB STMT
AN EXEC STMT INVOKING A PROC
A JOBLIB DD STMT
A DD * STMT
A DD DATA STMT
A /* (DELIMITER) STMT
A // (NULL) STMT
INPUT STREAM (SYSIN) DATA
A PEND STMT (FOR CATALOGED PROCEDURES ONLY)
Nagaraju Domala
In stream procedures
Nagaraju Domala
Catalogued procedures
Nagaraju Domala
Catalogued procedures(Contd..)
Nagaraju Domala
Modifying the Procedure
The biggest benefit of procedures is that minor adjustments can be made to
the JCL they contain to meet varying processing needs.
Nagaraju Domala
Modifying the Procedure ( Contd..)
EXEC:
Nagaraju Domala
Modifying the Procedure ( Contd..)
DD:to override any parameters in the dd statement, a
independent DD statement must be coded as given below:
Nagaraju Domala
Modifying the Procedure ( Contd..)
• PROCEDURE SSP
//S1 EXEC PGM=P1,PARM=&PEL
EXAMPLE 1
//A EXEC SSP,PEL=FLD
SUBSTITUTION RESULTS IN :
//S1 EXEC PGM=P1,PARM=FLD
EXAMPLE 2
//B EXEC SSP,PEL=‘FLD,TIME=(5,10)’
SUBSTITUTION RESULTS IN :
//S1 EXEC PGM=P1,PARM=FLD,TIME=(5,10)
Nagaraju Domala
Modifying the Procedure ( Contd..)
THE PROC STATEMENT :
• For those symbolic overrides not found in the exec stmt, the default symbolic
overrides in the proc stmt will be used
Nagaraju Domala
Modifying the Procedure ( Contd..)
Sample procedure:
//INV3000 PROC
//INV3010 EXEC PGM=INV3010
//SYSOUT DD SYSOUT=&CLASS
//INVMAST DD DSN=&DEPT..INVENTRY.MASTER, DISP=SHR
//INVSEL DD DSN=&&INVSEL,DISP=NEW,SPACE=(CYL,(&SPACE))
//SELCTL DD DUMMY
//INV3020 EXEC PGM=INV3020
//SYSOUT DD SYSOUT=&CLASS
//INVMAST DD DSNAME=&&INVSEL,DISP=(OLD,DELETE)
//INVSLST DD SYSOUT=&CLASS
// PEND
Nagaraju Domala
Modifying the Procedure ( Contd..)
EFFECTIVE JCL
//INV3010 EXEC PGM=INV3010
//SYSOUT DD SYSOUT=M
//INVMAST DD DSNAME=MMA2.INVENTRY.MASTER,DISP=SHR
//INVSEL DD DSNAME=&&INVSEL,DISP=(NEW,PASS),
// UNIT=SYSDA,SPACE=(CYL,(5,1))
//SELCTL DD DUMMY
//INV3020 EXEC PGM=INV3020
//SYSOUT DD SYSOUT=M
//INVMAST DD DSNAME=&&INVSEL,DISP=(OLD,DELETE)
//INVSLST DD SYSOUT=M
Nagaraju Domala