A message queue monitor that monitors the QSECOFR message queue for message ID CPI591A
uses this event program. This event program is called if the message arrives and the
line is active. The event program attempts to vary on the controller for the line
indicated in the message ID. Refer to Additional
data structures for information about the DTLINFO parameter.
Table 1. Event program example
PGM PARM(&MONITOR &EVTCLS &DTLINFO &RTNCOD &EXCPTID)
/*********************************************************************/
/* Parameters */
/*********************************************************************/
DCL &MONITOR *CHAR 10 /* Monitor name */
DCL &EVTCLS *CHAR 10 /* Event class */
DCL &DTLINFO *CHAR 752 /* Detail information based on event class */
DCL &RTNCOD *CHAR 1 /* Return code - 0=monitor status ACTIVE or */
/* group monitor INACTIVE */
/* 1=monitor status FAILED/ACT */
/* or group monitor FAILED */
/* 2=monitor status FAILED */
DCL &EXCPTID *CHAR 7 /* Exception ID for history log */
/*********************************************************************/
/* Local variables */
/*********************************************************************/
DCL &MSGID *CHAR 7
/* Get the message ID which is in the 21-27th positions of the detail */
/* information. */
CHGVAR VAR(&MSGID) VALUE(%SST(&DTLINFO 21 7))
/* If the message ID is CPI591A then attempt to Vary on the controller. */
IF COND(&MSGID *EQ 'CPI591A') THEN( +
VRYCFG CFGOBJ(CONTROLLER) CFGTYPE(*CTL) STATUS(*ON))
/* Set return code to '0' to tell the message queue monitor to remain */
/* active*/
CHGVAR &RTNCOD VALUE('0')
/* Set the exception ID to blanks since the return code is '0' */
CHGVAR &EXCPTID VALUE(' ')
ENDPGM
|