-REXC (REXX and CLIST macro execution)


The -REXC command allows a REXX or CLIST subroutine to execute outside of the worklist and return back to the worklist after the subroutine is completed.

In order to use this feature, you must perform the following actions:

  • Allocate any files required for the EXEC's processing either dynamically or via JCL.
    • For implicit data set location of the REXX exec the worklist must contain:

      -REXC 000450 MYREXX

      MYREXX is the member containing the REXX exec. The user must manually insert in the Execution JCL, for foreground or batch processing, the following DD statement:

      //SYSPROC DD DSN='loc.of.rexx.exec'

      Alternatively, you can specify the name of a partitioned data set in which a REXX EXEC is a member for the Sysexec option on the JCL Generation Jobcard Options panel. The name of the data set is included in the //SYSEXEC DD in the Execution JCL, as shown in the following example:

      //SYSEXEC DD DSN='loc.of.rexx.exec'
    • For explicit data set location of the REXX exec the worklist must contain:

      -REXC 000450 EX 'loc.of.rexx.exec(
      MYREXX)'
  • Ensure that the return code for the REXX exec is sent back through IKJEFT1B. This means that a final REXX statement of EXIT RC (where RC is the return code to pass back to AEXEMAIN) must be included.

Important

If the required return code is not passed back to AEXEMAIN, unless a TSO command abends, AEXEMAIN will receive a return code zero (RC=0) and continue to process the worklist.

Warning

We strongly recommend that you evaluate any REXX exec inserted in worklists in a test environment before implementing production versions of the macro. Particular care should be taken to determine whether any data sets are freed by the REXX exec that are allocated by ALTER or BMC AMI Change Manager for Db2. Execution of REXX macros that free data sets allocated by ALTER or Change Manager could have drastic and unpredictable results.

Related topic

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*