views:

561

answers:

3

Can we pass arguments to a REXX program from JCL?

I suppose, JCL PARM can be used as we use for passing arguments to COBOL programs.. Do put your ideas here...

+2  A: 

You want EXEC PGM=IRXJCL,PARM='member_name exec_args'. SYSEXEC should point to the PDS containing member name. SYSTSIN is the input for PULL, SYSTSPRT is the output DD for SAY

Check out the "Using REXX in TSO/E and Other MVS Address Spaces" chapter in the "TSO/E Rexx User Guide" book (SA22-7791) for a full example.

Ross Patterson
A: 

An added note: If your REXX exec uses ISPF services, you can run it in batch with PGM=IKJEFTxx (xx being a variable suffix) and allocating ISPxLIB in the job step.

Tony
A: 

If the parameters together with the REXX member name exceeds 100 bytes, the method mentioned by Ron Patterson won't work as JCL syntax only allows a maximum paramater length of 100 bytes. In this case I recommend using IKJEFTxx (already posted by Tony). You then have to pass the REXX program name as instream data to SYSTSIN. The parameters to this program can simply written behind the program name. When you need more than one line, use the hyphen as last character of a line to indicate the concatenation with the following line. Example:

//EXAMPLE  EXEC PGM=IKJEFT01,REGION=4096K,DYNAMNBR=30
//SYSPRINT DD  SYSOUT=*                              
//SYSEXEC  DD  DISP=SHR,DSN=YOUR.REXX.LIBRARY    
//SYSTSPRT DD  SYSOUT=*                              
//SYSTSIN  DD  *                                     
  SCHLABB PARAMETER1 PARAMETER2 PARAMETER3 -
          VERY_LONG_PARAMETER4             -
          LAST_PARAMETER5                                
/*                                                   
//                                                   
Stefan