Condition program example - assure_mimix - 10.0

Assure MIMIX Monitor Reference

Product type
Software
Portfolio
Integrate
Product family
Assure
Product
Assure MIMIX™ Software
Version
10.0
Language
English
Product name
Assure MIMIX
Title
Assure MIMIX Monitor Reference
Copyright
2023
First publish date
1999
Last edition
2024-08-07
Last publish date
2024-08-07T11:10:39.245672

This condition program is used by a message queue monitor that monitors the QSYSOPR message queue for message ID CPI591A (Controller varied off or not recognized by local system). When this message arrives on the QSYSOPR message queue, this condition program is called to verify that the line is active. If the line is active the event program is called. Otherwise, the condition program tells the monitor to continue. Refer to Additional data structures  for information about the DTLINFO parameter.

Table 1. Condition program example
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