Previous Topic: OPSOF003 Event—Connectivity Command AcceptedNext Topic: Hardware Event API Rules


How OPSOF001 Rule Selectively Varies Devices Online

Event OPSOF001 indicates that a switch operation has resulted in a status change for one or more devices.

When SOF makes connectivity changes, the following process occurs:

  1. The generic event OPSOF001 is issued for each contiguous block of devices affected by the command.
  2. The rule looks for devices which are now available.

    This indicates that the one or more paths for the device should now be functional, but the devices were not brought online by SOF.

  3. The rule then examines the device numbers and issues a VARY ONLINE command for only devices falling within a specific range of device numbers, for example, 8902-8907.

Example: API Rule for the OPSOF001 Event

The following sample API rule selectively varies online devices affected by a CA OPS/MVS SOF switch command.

)API OPSOF001
)PROC
  DEVSTAT = word(API.TEXT, 3)
  LOWDEV = x2d('8902')
  HIDEV  = x2d('8907')
  if DEVSTAT == 'AVAILABLE' then do
     DEV1 = x2d(word(API.TEXT,4))
     DEV2 = x2d(word(API.TEXT,5))
/*------------------------------------------------------------------*/
/* If no devices are in our range, we have nothing to do, so quit.  */
/*------------------------------------------------------------------*/
     if DEV1 > HIDEV  |  DEV2 < LOWDEV then return 0
/*------------------------------------------------------------------*/
/* Remove device numbers that are too low                           */
/*------------------------------------------------------------------*/
     if DEV1 < LOWDEV  then DEV1 = LOWDEV
/*------------------------------------------------------------------*/
/* Remove device numbers that are too high                          */
/*------------------------------------------------------------------*/
     if DEV2 > HIDEV then DEV2 = HIDEV
/*------------------------------------------------------------------*/
/* Construct the VARY command                                       */
/*------------------------------------------------------------------*/
     CMD = 'VARY ' || d2x(DEV1,4) || '-' || d2x(DEV2,4) || ',ONLINE'
/*------------------------------------------------------------------*/
/* Issue the command                                                */
/*------------------------------------------------------------------*/
     address oper  "COMMAND('" || CMD || "')"
     end
  return 0