In this example of a group user routine, the routine has two functions
to perform:
- Maintain a table containing the member names and member tokens
of members in the group. When a member becomes active, the group
user routine adds the member to the table.
- Initiate® a takeover
if the primary member in the group fails. This routine runs in a
group where one member is the primary member and another member is
the backup member.
To accomplish these functions, the group user routine is concerned
with two types of events:
- Member state changes (GEPLTYPE=GEMSTATE).
- Member status update missing. To test for this event, the routine
uses a test-under-mask operation, with a mask of X'30'. This covers
the following conditions:
- GEPLFLG2 = X'20', indicating that the GEPLMISR bit is on (the
member's status user routine reported a status update missing for
the member)
- GEPLFLG2 = X'10', indicating that the GEPLMISD bit is on (XCF
assumed a status update missing for the member).
The group user routine also has to be concerned with skipping of
events. The logic of the routine covers the possibility that either
a status update missing or a member state change event might have
been skipped.
The following describes the group user routine logic (see
Figure 1,
Figure 2, and
Figure 3 for a summary).
- The routine first checks to see if the event is member-related.
If not, the routine takes no action.
- If the event is member-related, the routine then checks to see
if one of the status update missing flags (GEPLMISR or GEPLMISD) is
on.