Hello,
Unsure what the 'third layer of PROC' meant. If it is something like below, then yes, the PARM value can be passed (a simple test is given below).
3 different PROCs, all residing within a PDS, passed through JCL; each PROC calling the other PROC from within.
//PROC1 PROC
//*
//STEP001 EXEC PGM=MMMDCAMS,PARM='OVRD=&OVRD,DING=&DING'
//STEPLIB DD DISP=SHR,DSN=XXXX.YYYY.ZZZZZZ
//SYSPRINT DD SYSOUT=*
//IDCDATA DD UNIT=3390,SPACE=(CYL,5)
//SYSUT1 DD *
LISTCAT ENT(&OVRD..&DING ) ALL
/*
//PROC2 EXEC PROC2
//*
// PEND
//PROC2 PROC
//*
//STEP002 EXEC PGM=MMMDCAMS,PARM='OVRD=&OVRD,NING=&NING'
//STEPLIB DD DISP=SHR,DSN=XXXX.YYYY.ZZZZZZ
//SYSPRINT DD SYSOUT=*
//IDCDATA DD UNIT=3390,SPACE=(CYL,5)
//SYSUT1 DD *
LISTCAT ENT(&OVRD..&NING ) ALL
/*
//*
//PROC3 EXEC PROC3
// PEND
//PROC3 PROC
//*
//STEP003 EXEC PGM=MMMDCAMS,PARM='OVRD=&OVRD,GJIN=&GJIN'
//STEPLIB DD DISP=SHR,DSN=XXXX.YYYY.ZZZZZZ
//SYSPRINT DD SYSOUT=*
//IDCDATA DD UNIT=3390,SPACE=(CYL,5)
//SYSUT1 DD *
LISTCAT ENT(&OVRD..&GJIN ) ALL
/*
//*
// PEND
JCL:
//*
//PROCLIB JCLLIB ORDER=MY.PRIME.LIB
//*
// SET OVRD='NNNN.JJJJ'
//*
//PROC1 EXEC PROC1,DING='LING',NING='NONG',GJIN='GJIN'
This is resolved to:
// SET OVRD='NNNN.JJJJ'
//*
//PROC1 EXEC PROC1,DING='LING',NING='NONG',GJIN='GJIN'
XXPROC1 PROC
XX*
XXSTEP001 EXEC PGM=MMMDCAMS,PARM='OVRD=&OVRD,DING=&DING'
IEFC653I SUBSTITUTION JCL - PGM=MMMDCAMS,PARM='OVRD=NNNN.JJJJ,DING=LING'
XXSTEPLIB DD DISP=SHR,DSN=XXXX.YYYY.ZZZZZZ
XXSYSPRINT DD SYSOUT=*
XXIDCDATA DD UNIT=3390,SPACE=(CYL,5)
XXSYSUT1 DD *
XXPROC2 EXEC PROC2
XXPROC2 PROC
XX*
XXSTEP002 EXEC PGM=MMMDCAMS,PARM='OVRD=&OVRD,NING=&NING'
IEFC653I SUBSTITUTION JCL - PGM=MMMDCAMS,PARM='OVRD=NNNN.JJJJ,NING=NONG'
XXSTEPLIB DD DISP=SHR,DSN=XXXX.YYYY.ZZZZZZ
XXSYSPRINT DD SYSOUT=*
XXIDCDATA DD UNIT=3390,SPACE=(CYL,5)
XXSYSUT1 DD *
XX*
XXPROC3 EXEC PROC3
XXPROC3 PROC
XX*
XXSTEP003 EXEC PGM=MMMDCAMS,PARM='OVRD=&OVRD,GJIN=&GJIN'
IEFC653I SUBSTITUTION JCL - PGM=MMMDCAMS,PARM='OVRD=NNNN.JJJJ,GJIN=GJIN'
XXSTEPLIB DD DISP=SHR,DSN=XXXX.YYYY.ZZZZZZ
XXSYSPRINT DD SYSOUT=*
XXIDCDATA DD UNIT=3390,SPACE=(CYL,5)
XXSYSUT1 DD *
XX*
XX PEND
XX PEND
XX*
XX PEND
Resolved SYSPRINTs look something like this:
a. PROC1.STEP001
IDCAMS SYSTEM SERVICES
LISTCAT ENT(NNNN.JJJJ.LING ) ALL
.......
b. PROC2.STEP002
IDCAMS SYSTEM SERVICES
LISTCAT ENT(NNNN.JJJJ.NONG ) ALL
......
c. PROC3.STEP003
IDCAMS SYSTEM SERVICES
LISTCAT ENT(NNNN.JJJJ.GJIN ) ALL