Previous Topic: Event Distribution Services

Next Topic: System Event Names


Sample Code

The following example shows the use of &INTREAD for receiving EDS notification. It also contains an example of an &EVENT verb.

VTAM node failure events will be generated if PPO is active and the standard DEFMSG commands have been executed, either in the READY procedure or some time prior to execution of this procedure, that is:

DEFMSG MSGID=(129,259,526,822) DELIVER=ALL +
    EVENTNAME=NODE.FAILED

If the node is critical, the event is reissued, and can then be picked up by a network recovery server which may be executing somewhere else in your product region.

&CONTROL
   &EVNAME = &STR $SNA.NODE.FAILED      -* Node failure event name
   &EVTYPE = &STR CONFIGURATION
-*
-*  Issue PROFILE command for $SNA.NODE.FAILED event receipt
-*
   &INTCMD -PROFILE EDS ENABLE=&0 +
     NAME=&EVNAME +
     TYPE=&EVTYPE
   &WAITSECS = 600          -* 10 mins
.MONEVENT
   &INTREAD TYPE=RESP +
      MDO=PPOMDO +
      WAIT=&WAITSECS
   &RC = &ZFDBK             -* Copy feedback info.
   &IF &FDBK = 4 &THEN +
    -* Nothing arrived
      &DO
          &WRITE LOG=YES TERM=NO &0 &EVNAME MONITOR ACTIVE, +
          * No node failures detected in past 10 mins.
          &GOTO .MONEVENT -* Go to wait again
      &DOEND
&IF &RC > 4 &THEN +
 &DO
    &WRITE MON=YES LOG=Y COLOR=RED DATA=MDO FAILURE +
    OCCURRED ON &0 MONITOR INTREAD. +
    FDBK=&ZFDBK,&ZMDORC,&ZMDOFDBK
 &DOEND
  &ASSIGN VARS=EVENTEXT FROM MDO=&STEM.TEXT
  &PARSE ARGS DATA=&EVENTEXT   
&IF .&1 EQ .STOP &THEN +
 -* Stop if STOP written
      &GOTO .ENDUP          -* to response queue
   &IF .&1 NE .N00102 &THEN +
  -* GOBACK if this is not an
      &GOTO .MONEVENT       -* EDS notification 
-* Extract event details from &MSG MDO
   &ASSIGN VARS=PRIRES  FROM MDO=&STEM.RESOURCE.PRIMARY
   &ASSIGN VARS=SECRES  FROM MDO=&STEM.RESOURCE.SECONDARY
   &ASSIGN VARS=NAME  FROM MDO=&STEM.EVENT.NAME
   &ASSIGN VARS=REF  FROM MDO=&STEM.EVENT.REFERENCE
   &ASSIGN VARS=ROUTCD  FROM MDO=&STEM.EVENT.ROUTCDE
   &ASSIGN VARS=CLASS  FROM MDO=&STEM.EVENT.TYPE
   &ASSIGN VARS=IST#  FROM MDO=PPOMDO.PPOCNTL.VTAMNUM
   &ASSIGN VARS=ISTTEXT  FROM MDO=PPOMDO.TEXT
-*
-*  Log the failure.  Pass the PPO MDO in case LOGPROC
-*  wants to do something with it.
-*
   &WRITE TERM=NO LOG=YES MDO=PPOMDO +
      DATA=&0 IST&IST# FAILURE DETECTED FOR +
 NODE &PRIRES,&SECRES PPOREF=&REF -*   &WRITE TERM=NO LOG=YES +
 -* Log the VTAM msg text
      DATA = &ISTTEXT -* -* For the purposes of this example, re-issue the event
 -* and go back to wait for further failure notification.
 -* Additional filtering or recovery code could be placed
 -* here, depending on installation requirements.
-*
   &EVENT NAME=SNA.RECOVERY.REQUIRED +
      RESOURCE=(&PRIRES,&SECRES) +
      TYPE=APPLICATION +
      MDO=PPOMDO
   &GOTO .MONEVENT 
-* Await next event 
-* 
.ENDUP
 &END