EMS Manual

Example of Retrieving Event Messages
EMS Manual426909-005
A-3
Overview of Application Logic
Overview of Application Logic
The example application in this appendix:
1. Starts a consumer distributor
2. Prompts the user for a CPU number
3. Opens the distributor for SPI communication; sends a distributor CONTROL
command message that:
Loads the compiled filter, which selects the event messages that originated on
the specified CPU
Passes the CPU number to the filter as a parameter
Connects $0 to the distributor as a source collector
4. Enters a loop that:
Requests filter-specified event messages from the consumer distributor
through use of a GETEVENT command message and response
Displays (at the terminal) the text that the EMSTEXT procedure produced,
based on the event message.
The program example consists of source statements for:
The DDL file that defines the subsystem ID and token name used by the filter
parameter
The event-message filter specification
The TAL program, which can be divided roughly as:
Definitions common to the TAL procedures
The get^cpu^num procedure, which prompts the user for the CPU number
The spi^control procedure, which generates and sends one distributor
CONTROL command message and processes the response
The displ^event procedure, which calls the EMSTEXT procedure to produce
display text and sends the formatted text to the terminal
The getevent^loop procedure, which generates and sends one distributor
GETEVENT command message and calls the displ^event procedure
The dist^intfc MAIN procedure
The TACL main source module
The COBOL main source module
The C main source module