JCL PROCEDURE
PROCEDURE (PROC)
1. Procedure is re-usable component, which consist of EXEC and DD statement.
2. Procedure are not submitted directly (it can be call).
There are 2 types of procedure
1. Instream procedure
2. Catalog procedure.
Procedure name max: 8 characters and min: 1 character.
Working of procedure
1. Declaration of proc.
2. Execution of proc.
3. Changing of parameters.
INSTREAM PROCEDURE:
It is defined within a job, with proc name starting with proc operand.
RULES:
Max 15 instream proc can be defined by one job.
Proc can be executed within in a jcl program in any activity.
Example:
Copying data from one dataset to another dataset.
Creation /deletion of datasets.
Sorting data.
DECLARATION OF instream procedure:
Instream procedure starts with proc and end with pend statements.
Instream procedure should defined, before any exec statement defined.
EXAMPLE:
// KC03P88E JOB 123,’SANDEEP’,NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//PROC1 PROC
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=KC03P88.SAMPLE.PS1,DISP(NEW,CATLG,DELETE),
// SPACE=(TRK(15,10,0)) ,DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
// SPACE=(TRK(15,10,0)) ,DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
// PEND
//STEP2 EXEC PROC=PR0C1 ----------------EXECUTION OR CALLING OF proc
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
CATALOG PROCEDURE:
It is defined outside of jcl program, in a PDS member with PROC and no PEND statement .
Catalog proc can be executed in any jcl program, across application .
Any member of catalog proc can be defined.
Important point :
1.Similar to JOBLIB & STEPLIB, PROCLIB must code with a jcl program immediate after job.
2.Catalog procedures are coded in a PDS member
3.Catalog procedure can be executed from any job across application.
4.To locate catalog procedure PROCLIB, system defined DD name be specified immediate.
5.Catalog procedure can be changed by using symbolic parameters.
6.Symbolic parameter: it is user defined name pre-fixing with single amperson (&).
EXAMPLE:
DECLARATION OF CATALOG PROCEDURE
KC03P88E.SAMPLE.PDS(MEM1)----------------------it’s PDS AND MEM1 IS MEMBER
//CATALOG1 PROC
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DSN=KC03P88.SAMPLE.PS1,DISP=SHR
//SYSUT2 DD DSN=KC03P88.SAMPLE.PS2,DISP=SHR
//SYSIN DD DUMMY
CALLING OF CATAOLG PROCEDURE
//KC03P88E JOB 123,’SANDEEP’,NOTFIY=&SYSUID
// JCLLIB ORDER=KC03P88E.SAMPLE.PDS
//STEP1 EXEC PROC=MEM1
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
MODIFY STATEMENT IN A PROCEDURE
There are two type of modification we do
On EXEC statement.
On DD statement.
On EXEC statement (symbolic parameters)
// KC03P88E JOB 123,’SANDEEP’,NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//PROC1 PROC
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=KC03P88.SAMPLE.&A,DISP=(NEW,CATLG,DELETE),
// SPCAE=(TRK,(15,10,0)), DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS) // PEND
//STEP2 EXEC PROC=PR0C1 ,A=ps1
//STEP3 EXEC PROC=PR0C1,A=PS2
//STEP4 EXEC PROC=PROC1,A=PS3
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
On DD statement
// KC03P88E JOB 123,’SANDEEP’,NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//PROC1 PROC
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=KC03P88.SAMPLE.PS,DISP=(NEW,CATLG,DELETE),
// SPCAE=(TRK,(15,10,0)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
// PEND
//STEP2 EXEC PROC=PR0C1
//STEP1.DD1 DSN=KC03P88.SAMPLE.PS1
//STEP1.DD1 DSN=KC03P88.SAMPLE.PS2
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
DIFFERENCE BETWEEN INSTREAM AND CATALOG PROCEDURE
INSTREAM
|
CATALOG
|
Coded within a jcl program. Coded outside of jcl program.
Executed within in a jcl program. Executed outside of jcl program.
No PROCLLIB is required to located procedure. PROCLLIB is required to locate procedure.
Proc & pend are required. No pend statement is required.
Max 15 instream procedure . global .
PROCEDURE (PROC)
1. Procedure is re-usable component, which consist of EXEC and DD statement.
2. Procedure are not submitted directly (it can be call).
There are 2 types of procedure
1. Instream procedure
2. Catalog procedure.
Procedure name max: 8 characters and min: 1 character.
Working of procedure
1. Declaration of proc.
2. Execution of proc.
3. Changing of parameters.
INSTREAM PROCEDURE:
It is defined within a job, with proc name starting with proc operand.
RULES:
Max 15 instream proc can be defined by one job.
Proc can be executed within in a jcl program in any activity.
Example:
Copying data from one dataset to another dataset.
Creation /deletion of datasets.
Sorting data.
DECLARATION OF instream procedure:
Instream procedure starts with proc and end with pend statements.
Instream procedure should defined, before any exec statement defined.
EXAMPLE:
// KC03P88E JOB 123,’SANDEEP’,NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//PROC1 PROC
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=KC03P88.SAMPLE.PS1,DISP=(NEW,CATLG,DELETE), DECLARATION OF
// SPCAE=(TRK,(15,10,0)), INSTREAM PROC.
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
// PEND
//STEP2 EXEC PROC=PR0C1 ------------------------------------EXECUTION OR CALLING OF PROC.
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
CATALOG PROCEDURE:
It is defined outside of jcl program, in a PDS member with PROC and no PEND statement .
Catalog proc can be executed in any jcl program, across application .
Any member of catalog proc can be defined.
Important point :
1.Similar to JOBLIB & STEPLIB, PROCLIB must code with a jcl program immediate after job.
2.Catalog procedures are coded in a PDS member
3.Catalog procedure can be executed from any job across application.
4.To locate catalog procedure PROCLIB, system defined DD name be specified immediate.
5.Catalog procedure can be changed by using symbolic parameters.
6.Symbolic parameter: it is user defined name pre-fixing with single amperson (&).
EXAMPLE:
DECLARATION OF CATALOG PROCEDURE
KC03P88E.SAMPLE.PDS(MEM1)----------------------it’s PDS AND MEM1 IS MEMBER
//CATALOG1 PROC
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DSN=KC03P88.SAMPLE.PS1,DISP=SHR
//SYSUT2 DD DSN=KC03P88.SAMPLE.PS2,DISP=SHR
//SYSIN DD DUMMY
CALLING OF CATAOLG PROCEDURE
//KC03P88E JOB 123,’SANDEEP’,NOTFIY=&SYSUID
// JCLLIB ORDER=KC03P88E.SAMPLE.PDS
//STEP1 EXEC PROC=MEM1
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
MODIFY STATEMENT IN A PROCEDURE
There are two type of modification we do
On EXEC statement.
On DD statement.
On EXEC statement (symbolic parameters)
// KC03P88E JOB 123,’SANDEEP’,NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//PROC1 PROC
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=KC03P88.SAMPLE.&A,DISP=(NEW,CATLG,DELETE),
// SPCAE=(TRK,(15,10,0)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
// PEND
//STEP2 EXEC PROC=PR0C1 ,A=ps1
//STEP3 EXEC PROC=PR0C1,A=PS2
//STEP4 EXEC PROC=PROC1,A=PS3
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
On DD statement
// KC03P88E JOB 123,’SANDEEP’,NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//PROC1 PROC
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=KC03P88.SAMPLE.PS,DISP=(NEW,CATLG,DELETE),
// SPCAE=(TRK,(15,10,0)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
// PEND
//STEP2 EXEC PROC=PR0C1
//STEP1.DD1 DSN=KC03P88.SAMPLE.PS1
//STEP1.DD1 DSN=KC03P88.SAMPLE.PS2
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
DIFFERENCE BETWEEN INSTREAM AND CATALOG PROCEDURE
INSTREAM
|
CATALOG
|
Coded within a jcl program. Coded outside of jcl program.
Executed within in a jcl program. Executed outside of jcl program.
No PROCLLIB is required to located procedure. PROCLLIB is required to locate procedure.
Proc & pend are required. No pend statement is required.
Max 15 instream procedure . global .
PROCEDURE (PROC)
1. Procedure is re-usable component, which consist of EXEC and DD statement.
2. Procedure are not submitted directly (it can be call).
There are 2 types of procedure
1. Instream procedure
2. Catalog procedure.
Procedure name max: 8 characters and min: 1 character.
Working of procedure
1. Declaration of proc.
2. Execution of proc.
3. Changing of parameters.
INSTREAM PROCEDURE:
It is defined within a job, with proc name starting with proc operand.
RULES:
Max 15 instream proc can be defined by one job.
Proc can be executed within in a jcl program in any activity.
Example:
Copying data from one dataset to another dataset.
Creation /deletion of datasets.
Sorting data.
DECLARATION OF instream procedure:
Instream procedure starts with proc and end with pend statements.
Instream procedure should defined, before any exec statement defined.
EXAMPLE:
// KC03P88E JOB 123,’SANDEEP’,NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//PROC1 PROC
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=KC03P88.SAMPLE.PS1,DISP=(NEW,CATLG,DELETE), DECLARATION OF
// SPCAE=(TRK,(15,10,0)), INSTREAM PROC.
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
// PEND
//STEP2 EXEC PROC=PR0C1 ------------------------------------EXECUTION OR CALLING OF PROC.
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
CATALOG PROCEDURE:
It is defined outside of jcl program, in a PDS member with PROC and no PEND statement .
Catalog proc can be executed in any jcl program, across application .
Any member of catalog proc can be defined.
Important point :
1.Similar to JOBLIB & STEPLIB, PROCLIB must code with a jcl program immediate after job.
2.Catalog procedures are coded in a PDS member
3.Catalog procedure can be executed from any job across application.
4.To locate catalog procedure PROCLIB, system defined DD name be specified immediate.
5.Catalog procedure can be changed by using symbolic parameters.
6.Symbolic parameter: it is user defined name pre-fixing with single amperson (&).
EXAMPLE:
DECLARATION OF CATALOG PROCEDURE
KC03P88E.SAMPLE.PDS(MEM1)----------------------it’s PDS AND MEM1 IS MEMBER
//CATALOG1 PROC
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DSN=KC03P88.SAMPLE.PS1,DISP=SHR
//SYSUT2 DD DSN=KC03P88.SAMPLE.PS2,DISP=SHR
//SYSIN DD DUMMY
CALLING OF CATAOLG PROCEDURE
//KC03P88E JOB 123,’SANDEEP’,NOTFIY=&SYSUID
// JCLLIB ORDER=KC03P88E.SAMPLE.PDS
//STEP1 EXEC PROC=MEM1
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
MODIFY STATEMENT IN A PROCEDURE
There are two type of modification we do
On EXEC statement.
On DD statement.
On EXEC statement (symbolic parameters)
// KC03P88E JOB 123,’SANDEEP’,NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//PROC1 PROC
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=KC03P88.SAMPLE.&A,DISP=(NEW,CATLG,DELETE),
// SPCAE=(TRK,(15,10,0)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
// PEND
//STEP2 EXEC PROC=PR0C1 ,A=ps1
//STEP3 EXEC PROC=PR0C1,A=PS2
//STEP4 EXEC PROC=PROC1,A=PS3
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
On DD statement
// KC03P88E JOB 123,’SANDEEP’,NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//PROC1 PROC
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=KC03P88.SAMPLE.PS,DISP=(NEW,CATLG,DELETE),
// SPCAE=(TRK,(15,10,0)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
// PEND
//STEP2 EXEC PROC=PR0C1
//STEP1.DD1 DSN=KC03P88.SAMPLE.PS1
//STEP1.DD1 DSN=KC03P88.SAMPLE.PS2
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
DIFFERENCE BETWEEN INSTREAM AND CATALOG PROCEDURE
INSTREAM
|
CATALOG
|
Coded within a jcl program. Coded outside of jcl program.
Executed within in a jcl program. Executed outside of jcl program.
No PROCLLIB is required to located procedure. PROCLLIB is required to locate procedure.
Proc & pend are required. No pend statement is required.
Max 15 instream procedure . global .
Comments
Post a Comment