jcl pass parameter to proc



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

jcl pass parameter to proc

Postby kvannisselroy » Sat Oct 17, 2020 2:32 pm

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.
kvannisselroy
 
Posts: 2
Joined: Sat Oct 17, 2020 2:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: jcl pass parameter to proc

 

Re: jcl pass parameter to proc

Postby NicC » Sat Oct 17, 2020 2:55 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3007
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: jcl pass parameter to proc

Postby kvannisselroy » Sat Oct 17, 2020 3:17 pm

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
kvannisselroy
 
Posts: 2
Joined: Sat Oct 17, 2020 2:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: jcl pass parameter to proc

Postby sergeyken » Sun Oct 18, 2020 6:51 am

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.
sergeyken
 
Posts: 103
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 2 times
Been thanked: 10 times

Re: jcl pass parameter to proc

Postby NicC » Mon Oct 19, 2020 1:17 am

Invoke your exec from the SYSTSIN DDname then you can make your parm
PARM=&BRON
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3007
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post