Rule-initiated REXX EXECs


An EXEC is Rule-initiated if its name is specified in the EXEC Name/Parms field of the Rule Processor Action Specification panel of a fired rule.

Refer to the Rule Processor chapters in the MainView AutoOPERATOR Basic Automation Guide, Volume 1: Using Rules for more information about writing Rules and how to write a Rule that schedules an EXEC.

Potential use

EXECs scheduled by a Rule through the Rule Processor application can perform automation that cannot be performed by a Rule.

For example, a Rule-initiated EXEC can, based on the text of a message, issue ALERTs, submit other EXECs, or invoke SYSPROG services. In general, use Rule-initiated EXECs to perform advanced automation as a result of a message.

Parameters passed to the EXEC

The individual words of the message that caused a Rule to fire are passed as input to the EXEC. A word is any character string separated by a blank or a comma.

Example of Input

The message

$HASP103 CMFTEXT BAB031

is an example of a message that can cause a Rule to fire. If the Rule has an EXEC associated with it, the words of this message are passed as parameters to the ARG statement of the EXEC.

Specifying additional parameters

From the Rule Processor Action Specification panel, you also can specify additional parameters that you want to send to the EXEC by using the EXEC/Parms field of any Action Specification panel.

Note

The first parameter specified in this field becomes the first parameter passed to the EXEC. Subsequent parameters are passed to the EXEC in the order that they were entered.

This sequence means that the message ID and any message text will not be passed to the EXEC. To have the message ID and any message text passed to the EXEC, the Rule must use the IMFTEXT variable.

Example

The following is an example of a Rule-initiated EXEC scheduled by the Rule handling the $HASP103 message.

Figure 1. Rule-Initiated REXX EXEC example

/*REXX EXEC */
ARG MSGID SETUP W2 W3
/*----------------------------------------------------------------*/
/* DOC GROUP(MVS) FUNC(JES2) CODE(J2)                             */
/* DOC DISP(YES) AUTHOR(B&B)                                      */
/* DOC DESC(RESPOND TO $HASP103 AND WRITE MESSAGE TO JOURNAL)     */
/*----------------------------------------------------------------*/

'IMFEXEC MSG 'JOB 'SETUP' IS REQUESTING 'W2'''
EXIT

The positional parameters that are passed to the ARG statement of the Rule-initiated EXEC are shown in the following table:

Positional parameter

Variable name

Value passed

Description of value passed

1

MSGID

$HASP103

message ID of the message that fired the Rule that calls this EXEC

2

SETUP

CMFTEXT

name of the job requesting a tape mount

3

W2

BAB031

volume serial number of the tape to be mounted

4

W3

.

dummy value used to fill in for the fourth parameter that was not passed with the message

Describing the example

This EXEC issues the IMFEXEC MSG command to write a message to the BBI-SS PAS Journal that, when all the values from the input are substituted for the ARG statement parameters, translates into

JOB CMFTEXT IS REQUESTING BAB031

For information about Rule-initiated EXECs and retrieving information from MVS multiline WTOs or IMS multisegment messages, refer to rule-initiated execs initiated by mvs multiline or multisegment messages.

 

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