How to catch two messages at the same time?
search cancel

How to catch two messages at the same time?

book

Article ID: 91837

calendar_today

Updated On:

Products

OPS/MVS Event Management & Automation

Issue/Introduction

How to correlate the execution of one rule with the execution of another rule? 
For example, a product issues the following 2 messages:

PDT0185 ABEND=S0C1 MODULE=DT$DII OFFSET=00005E64 DB2=101 
PDT0102 DETECTOR TERM IN PROGRESS FOR DB2=XXX USER=CONSOLE 

A restart of the service must be performed when the second message appears but only when first message has also appeared.

Environment

Release:
Component: OPSMVS

Resolution

Address space related variables (GLVJOBID) can be used to save information from the first execution of the rule to be used at the second rule.
For example, the first message rule would be:
)MSG PDT0185
)PROC


GLVJOBID.ABEND = 'YES'

At the other message rule:
)MSG PDT0102
)PROC



if OPSVALUE('GLVJOBID.ABEND','E') = 'N' then /* if the variable does not exist exit */
return
/* Take actions here to restart the service */

/* then delete the variable to prepare to the next execution */



REM = OPSVALUE('GLVJOBID.ABEND','R')




 

Additional Information

Reference to the usage of the GVLJOBID variable type can be found in the link below:

https://docops.ca.com/ca-opsmvs-13-0/en/using/using-automated-operations-facility-aof-rules/aof-rule-tools/aof-variables#AOFVariables-AddressSpace-relatedVariables

Reference to the OPSVALUE function:

https://docops.ca.com/ca-opsmvs-13-0/en/reference-information/command-and-function-reference/ops-rexx-built-in-functions/opsvalue-function