PAM Management Programming Manual

SPI Programming Considerations for the PAM
Subsystem
PAM Management Programming Manual142481
3-10
Event-Management Considerations for the PAM
Subsystem
4. Read the response from the distributor using the mechanism appropriate to your
programming language (for example, a WRITEREAD in TAL).
5. Repeat the following steps in a loop:
a. Format and send a GETEVENT command to the consumer distributor to get the
next event message, using the mechanism appropriate to your programming
language (for example, a WRITEREAD in TAL).
b. Read the response from the distributor using the mechanism appropriate to your
programming language (for example, a WRITEREAD in TAL).
c. Call SSMOVE or SSMOVETKN to move the context token from the response
buffer into the GETEVENT command buffer. The context token will be needed
later, when your application resends the command to get the next event message.
d. Call SSGET or SSGETTKN to retrieve the token containing the event message
(ZEMS-TKN-EVENT) from the response buffer.
e. Call EMSGET or EMSGETTKN to retrieve the subsystem ID (ZSPI-TKN-
SSID) and event number (ZEMS-TKN-EVENTNUMBER) from the event
message. Together, these two tokens identify the event message and determine
what information tokens it will contain.
f. Call EMSGET or EMSGETTKN twice to retrieve the subject of the event
message. In the first call, retrieve the subject-mark token (ZEMS-TKN-
SUBJECT-MARK) to get the token code and index of the token identifying the
subject. Then make another call to retrieve the subject token itself.
g. Call EMSGET or EMSGETTKN to retrieve the values of other tokens from the
event message.
h. If you encounter the error-list token (ZSPI-TKN-ERRLIST), make another call
to EMSGET or EMSGETTKN to retrieve the tokens inside the error list.
i. Take action appropriate to the information in the event message.
The EMS Manual provides information on how to retrieve tokens from an event
message. The SPI Common Extensions Manual provides additional information specific
to data communications subsystems.
Event-Management Considerations for the PAM Subsystem
The minimum PAM event message buffer size is 128 words. The entire event message
buffer is contained in the token ZEMS-TKN-EVENT. This token is, in turn, contained in
the response buffer for the GETEVENT command. Refer to the EMS Manual for more
information about event message buffers.
Critical Events
Events reported by the PAM subsystem are divided into two classes: critical events and
noncritical events. Critical events are those for which the consequences could be serious,
such as the loss of a device or the occurrence of certain errors. Noncritical events are
often expected events, such as a line becoming ready.