PGM PARM(&MONITOR &EVTCLS &DTLINFO &RTNCOD)
/*********************************************************************/
/* 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=call event program */
/* 1=If group monitor, program */
/* failed, monitor status is */
/* INACTIVE. Otherwise, */
/* continue to monitor, do */
/* not call event program */
/*********************************************************************/
/* Local variables */
/*********************************************************************/
DCL &MSGID *CHAR 7
DCL &STATUS *DEC LEN(5 0)
/* Set the return code to 1 to default to not call the event program */
CHGVAR &RTNCOD VALUE('1')
/* If the event class is *MSGQ then get the message ID that caused */
/* the condition program to be called from the detail information. */
IF (&EVTCLS *EQ '*MSGQ ') THEN(DO)
CHGVAR &MSGID VALUE(%SST(&DTLINFO 21 7))
/* If the message ID is CPI591A then verify that the line is */
/* active (STATUS = 60). If it is active then call the event pgm.*/
IF (&MSGID *EQ 'CPI591A') THEN(DO)
RTVCFGSTS CFGD(TRNLINE) CFGTYPE(*LIN) STSCDE(&STATUS)
IF (&STATUS *EQ 60) THEN( +
CHGVAR &RTNCOD VALUE('0'))
ENDDO
ENDDO
ENDPGM
|