jcl pass parameter to proc

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...
kvannisselroy
Posts: 2
Joined: Sat Oct 17, 2020 2:14 pm
Skillset: db2 rexx
Referer: google

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?



Code: Select all

//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.

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

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

kvannisselroy
Posts: 2
Joined: Sat Oct 17, 2020 2:14 pm
Skillset: db2 rexx
Referer: google

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?

Code: Select all

//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


Code: Select all

//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

User avatar
sergeyken
Posts: 458
Joined: Wed Jul 24, 2019 10:12 pm
Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
Referer: Internet search

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.
Javas and Pythons come and go, but JCL and SORT stay forever.

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

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

Code: Select all

PARM=&BRON
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic


  • Similar Topics
    Replies
    Views
    Last post