Invoking REXX thru JCL passing variables



IBM's Command List programming language & Restructured Extended Executor

Invoking REXX thru JCL passing variables

Postby gpessine » Thu May 04, 2017 1:50 am

Hi guys!

I have the following problem: I have a JCL which has 2 variables: &DB and &TS, which is passed by the PROC that calls it.

Now I need to call a REXX program, passing these variables &DB and &TS so the program will create a member with this information on it.

However, I do not know how to call the REXX, since the examples I found have the paramenter between quotes, and if I put something like

//STEP1 EXEC PGM=IRXJCL,PARM='MYEXEC &DB &TS'

it won't recognize &DB and &TS as variables, not replacing the text with the values itself.

Can anyone help me?
gpessine
 
Posts: 2
Joined: Thu May 04, 2017 1:45 am
Has thanked: 2 times
Been thanked: 0 time

Re: Invoking REXX thru JCL passing variables

Postby Robert Sample » Thu May 04, 2017 2:35 am

Using the coding requirements in the JCL Reference manual, it's working fine for me:
1 //RLSTEST  JOB  (10100000),RSAMPLE,CLASS=S,MSGCLASS=8              
   //*        RESTART=STEP13,COND=(0,LE)                              
   //*                                                                
 2 // SET DB=XYZ                                                      
 3 // SET TS=ABCDEFG                                                  
 4 //STEP1    EXEC PGM=IEFBR14,                                      
   // PARM='MYEXEC &DB &TS'                                          
   IEFC653I SUBSTITUTION JCL - PGM=IEFBR14,PARM='MYEXEC XYZ ABCDEFG'  
The requirements listed are (emphasis added by me):
You can code symbols in apostrophes on the following keywords:
•The DD statement AMP parameter
•The DD statement PATH parameter
•The DD statement SUBSYS parameter
•The EXEC statement ACCT parameter
•The EXEC statement PARM parameter.

When you specify these parameters, the system regards a string beginning with an ampersand (&) inside the apostrophes as a symbol when the following conditions are true:
•The character following the ampersand is not another ampersand.
•The characters following the ampersand are ended by a character that is not alphabetic, numeric, or national. The ending character must be not more than 9 characters after the ampersand. The symbol cannot be more than 8 characters long.
•The string of characters delimited by the & (ampersand) character and the ending character is:
Defined as a symbol on a PROC, EXEC, or SET statement
◦A system symbol.


These users thanked the author Robert Sample for the post:
gpessine (Fri May 05, 2017 5:23 am)
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Invoking REXX thru JCL passing variables

Postby Pedro » Fri May 05, 2017 4:12 am

This worked for me:
//PSV02   JOB ,                                              
//   USER=PEDRO,NOTIFY=PEDRO,TIME=(,59),MSGCLASS=H,REGION=16M
//*                                                          
//REXXPR PROC   DB=DB1,TS=TS1                                
//*                                                          
//STEP2    EXEC PGM=IRXJCL,PARM='TESTPARM &DB &TS'            
//SYSEXEC  DD DSN=PEDRO.CLIST.CLIST,DISP=SHR                  
//SYSTSPRT DD SYSOUT=*                                        
//SYSPRINT DD SYSOUT=*                                        
//SYSOUT   DD SYSOUT=*                                        
//SYSTSIN  DD DUMMY                                          
//*                                                          
//       PEND                                                
//*                                                          
//PSV2TSO     EXEC REXXPR,DB=MYDB,TS=MYTS                    


Can you show us your job? And the proc if it is separate.
Pedro Vera

These users thanked the author Pedro for the post:
gpessine (Fri May 05, 2017 5:24 am)
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Invoking REXX thru JCL passing variables

Postby gpessine » Fri May 05, 2017 5:23 am

Hi guys

It worked as in your example. Thanks a lot for your help!
gpessine
 
Posts: 2
Joined: Thu May 04, 2017 1:45 am
Has thanked: 2 times
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post