Page 1 of 1

jcl pass parameter to proc

PostPosted: Sat Oct 17, 2020 2:32 pm
by kvannisselroy
Hello,

I would like to pass a variable from jcl to a proc and use that parameter as input for a rexx program, how do i solve that?



//PARM     JOB 999BCS0,                                                
//             REGION=256M,                                            
//             CLASS=A,                                                
//             COND=(4,LT),                                            
//             NOTIFY=&SYSUID                                          
//         SET DB2SSID=DA0O                                            
//      JCLLIB ORDER=(DB2.&DB2SSID..PROCLIB,                          
//             OMIH.B01.PROC)                                          
//     INCLUDE MEMBER=JOBLDB2                                                
//GEEFPARM EXEC PROC=PROCREXX,                                                                                
//             BRON=COA                                              

//PROCREXX  PROC                                                                                                
//SHOWPARM EXEC PGM=IKJEFT01,PARM=('SHOWPARM &BRON.')                
//SYSEXEC  DD DISP=SHR,DSN=OMIH.B01.EXEC                              
//SYSTSPRT DD SYSOUT=*                                                
//SYSTSIN  DD DUMMY                                                    
//UITVOER  DD SYSOUT=*                                                
//PROCREXX PEND

Coded for you. Please do it yourself in future.

Re: jcl pass parameter to proc

PostPosted: Sat Oct 17, 2020 2:55 pm
by NicC
What problems are you having? It looks about right except: your inline procedure needs to be coded before the execution of it. You do not need a JCLLIB as you are using an inline proc. We do not know what is in the include statement that may change those comments.
And please use the code tags when posting code and data.

Re: jcl pass parameter to proc

PostPosted: Sat Oct 17, 2020 3:17 pm
by kvannisselroy
thank you for replying. The jcllib refers to the lib where it can find the proc, it is not an inline proc, these are two separate datasets.
The include is in this case not relevant but it refers to the dd of db2 libs, but my simple rexx is not using db2.
The problem is that the parameter BRON is not translated, because it is between quotes.
How do i solve that?

//PARM     JOB 999BCS0,                                                
//             REGION=256M,                                            
//             CLASS=A,                                                
//             COND=(4,LT),                                            
//             NOTIFY=&SYSUID                                          
//         SET DB2SSID=DA0O                                            
//      JCLLIB ORDER=(OMIH.B01.PROC)                                                                                        
//GEEFPARM EXEC PROC=PROCREXX,                                                                                
//             BRON=COA


//PROCREXX  PROC                                                                                                
//SHOWPARM EXEC PGM=IKJEFT01,PARM=('SHOWPARM &BRON.')                
//SYSEXEC  DD DISP=SHR,DSN=OMIH.B01.EXEC                              
//SYSTSPRT DD SYSOUT=*                                                
//SYSTSIN  DD DUMMY                                                    
//UITVOER  DD SYSOUT=*                                                
//PROCREXX PEND

Re: jcl pass parameter to proc

PostPosted: Sun Oct 18, 2020 6:51 am
by sergeyken
Please, read carefully the explanation iven by NicC:

Aany inline JCL PROC must be placed within any job before any EXEC statement of this job. Period.

Re: jcl pass parameter to proc

PostPosted: Mon Oct 19, 2020 1:17 am
by NicC
Invoke your exec from the SYSTSIN DDname then you can make your parm
PARM=&BRON