Can you execute a PROC from another PROC?
Answers were Sorted based on User's Feedback
Answer / sivakumar sekharannair
We can execute a proc from another proc. I tried and
executed sucessfully.
my job steps:
//PROCLIB JCLLIB ORDER=PROGMR.SIVANAIR.JCLLIB
//JOBLIB DD DSN=UAUT.NDVR.PGMLOAD,DISP=SHR
//STEP001 EXEC AUT001
first proc steps:
//AUT001 PROC
//STEP001 EXEC PGM=AUT0EMP,COND=(0,LE)
//EMPLOY1 DD DSN=PROGMR.SBPD.EMP.DATA.SAMPLE1,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//STEP002 EXEC AUT002
Second proc steps:
//AUT002 PROC
//STEP001 EXEC PGM=AUT0EMP
//EMPLOY1 DD DSN=PROGMR.SBPD.EMP.DATA.SAMPLE1,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
JOb log:
JOBNAME STEPNAME PROCSTEP RC EXCP CPU SRB CLOCK
AAUT001D STEP001 STEP001 00 48 .00 .00 .00
VS0010I AAUT001D 08.206 C STEP002 STEP001 ** R0000 **
AAUT001D STEP002 STEP001 00 48 .00 .00 .00
EF404I AAUT001D - ENDED -
Is This Answer Correct ? | 20 Yes | 2 No |
Answer / satyasivaji.ch
yha we can excute proc with in a proc(nested procedures),you
can code up to 15 levels of procedure we can execute.
Is This Answer Correct ? | 6 Yes | 3 No |
Answer / tanji
Answer to #5:
Need to give the lib of all the proc in the jcllib,With
that the second and subsequent proc will be identifies the
the executing proc.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / guest
I did not know the answer and my interviewer said NO. Later
I tried and executed PROC from a PROC, three levels deep.
Manuals do not state any limit on PROC calling PROC, or nesting.
Is This Answer Correct ? | 6 Yes | 5 No |
Answer / sachin
Please tell me shive
job knows where is first proc reside using JCLLIB
but how the proc2 will know where is proc3 reside.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kingmanish
First of all what is a PROC.
Its just a set of reusable JCL statements.
Now calling PROC within a PROC will defeat the concept of
PROCs itself.
So if we call a PROC within a PROC it would work and we can
do that.
But that is not a good practice.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / nikhil
You can code only exec pgm=pgm-name in a PROC but not exec
procname in any kind of PROC.
Is This Answer Correct ? | 0 Yes | 5 No |
I have three files for one step i need to override the third file how to do that in jcl?
how many members can be created inside a single pds?
What is the function of the dd dcb keyword?
A chkpt is the parameter coded for multi-volume qsam datasets in a dd statement. When a chkpt is coded as chkpt=eov, a checkpoint is written to the dataset specified in the sysckeov statement at the end of each volume of the input/output multi-volume dataset. State whether true or false?
When we give TYPERUN = SCAN , what are the syntax errors we get?
What is the difference between BLKSIZE and LRECL?
When will we need to specify Space parameter ?
The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The disp in the JCL is SHR and the pgm opens the file in EXTEND mode. What happens ?
How many types of libraries are there in JCL ?
what is the job entry system used in your project?
what happens if job falls in loop ? how to resolve it ?
I have a cobol db2 program(PGM A) where other program (PGM B) will call this program and passes some 50 fields data to PGM A. PGM A has some layout in which it receives the data from PGM B. And this layout has been copied in the linkage section pf PGM A. After getting the data, PGM A writes the data in a flat file in the same layout which it receives from PGM B. PGM B is a simple COBOL pgm. Please provide a JCL to run these programs.