Page 1 of 1

Doubt in overriding the JCL

PostPosted: Fri Dec 23, 2016 9:42 am
by sosu_1
Can anyone advise how to override PARM variables in JCL for third layer of proc.
My main PROC calls a PROC2(second proc) which again calls PROC3 ( third one) and have a PARM value which is used in the PROC3.
PARM needs to be overridden in JCL.
eg:PARM='1235Y 0216'

Re: Doubt in overriding the JCL

PostPosted: Fri Dec 23, 2016 9:52 am
by steve-myers
Do not post in inappropriate forums. Perhaps a moderator will move this to JCL, where the topic starter will have a chance to get a response to this query. Originally posted in Forum rules.

Re: Doubt in overriding the JCL

PostPosted: Fri Dec 23, 2016 2:43 pm
by prino
sosu_1 wrote:Can anyone advise how to override PARM variables in JCL for third layer of proc.

You cannot. Period. Full stop. End of story!

Re: Doubt in overriding the JCL

PostPosted: Fri Dec 23, 2016 4:46 pm
by Aki88
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