In a JCL a catalogued proc is called. In that catalogued procedure can again another catalogued procedure called?"
The answer, of course, is YES. We can nest procedures up to 15 levels.
The following shows how procedures can be nested:
Procedure C:
//C PROC
//CS1 EXEC PGM=GHI
.
// PEND
Procedure B:
//B PROC
//BS1 EXEC PROC=C
.
//BS2 EXEC PGM=DEF
.
// PEND
Procedure A:
//A PROC
//AS1 EXEC PROC=B
.
//AS2 EXEC PGM=ABC
.
// PEND
Job Stream:
//JOB1 JOB
//STEP1 EXEC PROC=A
.
//STEP2 EXEC PGM=JKL
.
.
The following statements are equivalent to the nested procedures shown above and show the levels of nesting (scoping) for the procedures.
//JOB1 JOB Level 0
//CS1 EXEC PGM=GHI Level 3
.
//BS2 EXEC PGM=DEF Level 2
.
//AS2 EXEC PGM=ABC Level 1
.
//STEP2 EXEC PGM=JKL Level 0
.
.
The answer, of course, is YES. We can nest procedures up to 15 levels.
The following shows how procedures can be nested:
Procedure C:
//C PROC
//CS1 EXEC PGM=GHI
.
// PEND
Procedure B:
//B PROC
//BS1 EXEC PROC=C
.
//BS2 EXEC PGM=DEF
.
// PEND
Procedure A:
//A PROC
//AS1 EXEC PROC=B
.
//AS2 EXEC PGM=ABC
.
// PEND
Job Stream:
//JOB1 JOB
//STEP1 EXEC PROC=A
.
//STEP2 EXEC PGM=JKL
.
.
The following statements are equivalent to the nested procedures shown above and show the levels of nesting (scoping) for the procedures.
//JOB1 JOB Level 0
//CS1 EXEC PGM=GHI Level 3
.
//BS2 EXEC PGM=DEF Level 2
.
//AS2 EXEC PGM=ABC Level 1
.
//STEP2 EXEC PGM=JKL Level 0
.
.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.