Previous Topic

Next Topic

Book Contents

Book Index

Execute a REXX Procedure in Response to a Job Abend

The example in Figure 102 demonstrates how a Control-O rule can respond to a detected message by activating a REXX procedure.

Figure 102 Example of Executing a REXX Procedure in Response to a Job Abend

ON MESSAGE  = IEF450I

   JNAME          JTYPE         SMFID        SYSTEM

   ROUTE          DESC          CONSOLEID    CONSOLE

   APPEARED       TIMES IN      MINUTES                        And/Or/Not

OWNER IOAADMIN GROUP                         MODE PROD    RUNTSEC

THRESHOLD

DESCRIPTION JOB ABENDED - EXECUTE A REXX PROCEDURE

DESCRIPTION PASS THE JOBNAME AS A PARAMETER TO IT

===========================================================================

DO TSO      = MYREXX %%$JOBNAME

   WAITMODE   Y                                      TIMEOUT         STOP Y

   INITPROC                 SHARELOC N               IMMEDIATE N

IF       %%$TSORC NE 0

DO SHOUT    = TO OPER              URGENCY R SYSTEM           CTO282I

   MESSAGE PROBLEMS WHILE EXECUTING REXX PROCEDURE MYREXX

ENDIF

Explanation

The appearance of the IEF450I message activates this rule that in turn activates the REXX procedure. This procedure can be used, for example, to open a ticket in a problem management product (such as NETMAN or INFOMAN).

The %%$JOBNAME system variable contains the name of the job that issued the message that triggered the rule.

DO TSO=MYREXX %%$JOBNAME

This statement activates the MYREXX REXX procedure and passes the value of the %%$JOBNAME system variable as an argument.

An IF statement checks the %%$TSORC system variable, which contains the return code of the REXX procedure.

If the return code is not 0, meaning that the procedure did not end OK, the operator is informed by a SHOUT message.

Parent Topic

Working With Control-O Rules