Using the REXX Batch Processor (IRXJCL)

You can execute the platform server REXX execs by submitting JCL that executes the REXX batch processor, IRXJCL.

The REXX batch processor (IRXJCL) can be used to execute REXX commands. The input to the IRXJCL program are embedded in the PARM statement of the EXEC JCL card. The platform server execs can be entered directly on the PARM JCL statement or called by another exec. However, only REXX execs can be executed directly from the PARM statement; no REXX keywords can be used within this environment. This means that you can execute the platform server commands directly within the PARM statement, but if you want to use REXX keywords such as IF and DO, you must add the exec to a member of the EXECS, and execute that exec from the IRXJCL PARM.

Examples

The following examples show how to run REXX execs from the REXX batch processor:

Example 1:

//jobcard  JOB ,'  ',MSGCLASS=X,CLASS=A       
//S1   EXEC PGM=IRXJCL,
//  PARM=’exec to be executed’                                           
//STEPLIB   DD DSN=FUSION.LOADLIB,DISP=SHR                    
//SYSEXEC   DD DSN=FUSION.EXECS,DISP=SHR                  
//SYSTSPRT  DD SYSOUT=*                                         
//SYSTSIN   DD DUMMY                                                
//

This example shows a sample JCL needed for processing the REXX batch processor.

Example 2:

//jobcard  JOB ,'  ',MSGCLASS=X,CLASS=A       
//S1   EXEC PGM=IRXJCL,
//  PARM=’FUSSEND IPADDR=192.192.192.100 IPPORT=46464 LF=local.file
//             RF=remote.file INTERVAL=3 SAY CFG=fusion wait’ 
//STEPLIB   DD DSN=FUSION.LOADLIB,DISP=SHR                    
//SYSEXEC   DD DSN=FUSION.EXECS,DISP=SHR                  
//SYSTSPRT  DD SYSOUT=*                                         
//SYSTSIN   DD DUMMY                                                
//

This examples shows a sample JCL of using the REXX batch processor to execute a platform server REXX exec.

Note: The PARM statement cannot exceed 100 characters. This is a restriction of the JCL processor. If the PARM statement cannot be contained on a single line, you must perform the following actions:
  • Enclose the PARM statement in single quotation marks.
  • Code the characters up to column 71.
  • Continue the PARM statement on the next JCL card starting in column 16.

Example 3:

//jobcard  JOB ,'  ',MSGCLASS=X,CLASS=A       
//S1   EXEC PGM=IRXJCL,PARM=’SENDPROD’                                           
//STEPLIB   DD DSN=FUSION.LOADLIB,DISP=SHR                    
//SYSEXEC   DD DSN=FUSION.EXECS,DISP=SHR                  
//SYSTSPRT  DD SYSOUT=*                                         
//SYSTSIN   DD DUMMY                                              
//

This example shows a sample JCL of executing a REXX exec that is a member of the EXECS file. Member SENDPROD of the platform server EXECS library will then contain the following REXX exec:

/*     REXX      */       
FUSSEND 'IPADDR=192.192.192.100 IPPORT=46464 LF=local.file’, ‘RF=remote.file INTERVAL=3
         SAY CFG=fusion wait’
IF RC = 0 THEN DO                                                     
   SAY   '0 RETURN CODE FROM FUSSEND'                                     
   EXIT 0                                                                 
 END                                                                     
ELSE   DO                                                                
   SAY   'RETURN CODE FROM FUSSEND=' RC                               
   EXIT 8                                                                 
 END
Note: The parameters of the FUSSEND command are enclosed in single quotation marks, which are required when a REXX exec includes a command. This is a restriction of the TSO and REXX environments.

Advantages and Disadvantages

The following are advantages and disadvantages of using the REXX batch processor:

  • Advantages
    • You can use this method in an unattended production environment.
    • Return code processing can be used to check the status of the request.
    • You can perform a process override to change the PARM statement.
  • Disadvantages
    • Only one command can be entered on the PARM statement.
    • The PARM statement restriction of 100 characters might limit the command requested.
    • You cannot execute certain TSO commands such as ALLOC and FREE in this environment.