REXX programs
Input variables
The following table describes the REXX stem variables that are set when the REXX program is invoked:
Stem name | Index | Description |
---|---|---|
BMC_EXCEPTIONS_PARMS.EXCEPTION_NAME | BMC_EXCEPTIONS_PARMS.1 | Name of the exception from the threshold row being evaluated |
BMC_EXCEPTIONS_PARMS.EXEC_NAME | BMC_EXCEPTIONS_PARMS.2 | Name of the REXX program from the threshold row being evaluated |
BMC_EXCEPTIONS_PARMS.SSID | BMC_EXCEPTIONS_PARMS.3 | Db2 SSID |
BMC_EXCEPTIONS_PARMS.QUALIFIER | BMC_EXCEPTIONS_PARMS.4 | Qualifier of the object being analyzed For type TS, it is the database name. For type IX, it is the creator name. |
BMC_EXCEPTIONS_PARMS.NAME | BMC_EXCEPTIONS_PARMS.5 | Name of the object being analyzed For type TS, it is the table space name. Fo type IX, it is the index name. |
BMC_EXCEPTIONS_PARMS.OBJTYPE | BMC_EXCEPTIONS_PARMS.6 | Type of the object being analyzed It is TS for table space and IX for index. |
BMC_EXCEPTIONS_PARMS.PARTNUM | BMC_EXCEPTIONS_PARMS.7 | Partition number being analyzed This number can be 0. |
BMC_EXCEPTIONS_PARMS.ACTION | BMC_EXCEPTIONS_PARMS.8 | Corrective action that is defined for the exception |
Return data
By default, the simple variable BMC_EXCEPTIONS_TRIGGER is set to FALSE.
You can cause BMCTRIG to indicate that an exception has occurred for the threshold by setting the variable to TRUE as follows:
Connecting to Db2
The REXX programs run under a separate TCB than BMCTRIG.
Therefore, the REXX program must establish a connection to Db2, which creates a new Db2 thread. When using DSNREXX, you can interact with Db2 in either of the following ways:
- Db2 Call Level Interface
- ADDRESS DSNREXX
SYSEXEC
Ensure that your BMCTRIG JCL contains a SYSEXEC with the PDS(s) for executing the REXX programs.
The SYSEXEC is defined in the JCL Options File (POF) that is created during installation. You can view and modify options online. For more information about the JCL POF, see Using-the-product-options-file-POF.
Environment and error recovery
To invoke the user-defined REXX programs, BMCTRIG establishes a REXX environment under a separate task by using the IBM TSO/E environment service IKJTSOEV.
Some TSO services are not available in this environment. After BMCTRIG evaluates all exceptions, it detaches the subtask and removes the TSO/E environment. If an abend occurs in the subtask, BMCTRIG discontinues evaluating user-defined exceptions but continues with other processing.
For more information about REXX and the TSO/E environment, see the TSO/E REXX Reference and TSO/E Programming Services from IBM.
Sample
DASD MANAGER PLUS provides a sample REXX program in the HLQ.EXEC PDS named ASURTSRS.
The sample program queries the IBM Db2 Real-time Statistics tables to determine whether it is necessary to update the catalog statistics due to insert, update, and delete activity on the table space or index.