EMS Manual

Example of Retrieving Event Messages
EMS Manual426909-005
A-34
Program Modifications
Program Modifications
This subsection suggests how you can modify this example application to demonstrate
different aspects of the programmatic interface. You might need to change the example
by easy stages into a practical application.
Modifications—shown in TAL—can be used literally if your program is in TAL, or as a
guide to program logic if your program is in TACL, COBOL, or C.
Processing Retrieved Event Messages
Displaying event messages, as done by the displ^event procedure, is one of many
possible ways to process messages retrieved by an application. You might replace
displ^event with a procedure that prepares a summary of events or with a procedure
that takes action to correct problems. For example, a program could bring down a line
when serious problems occur.
Filter Parameters
To change the example’s existing parameter or to add additional parameters:
Modify the statements in the spi^cmd^load^filter procedure below the comment:
! Place the filter-parameter token in the buffer.
Add similar groups of statements to pass additional parameters.
Modify the definitions of parameter tokens in the DDL file and recompile the DDL
file.
Modify the parameter definitions in the filter and recompile the filter.
Modify the get^cpu^num procedure to prompt the user for the new parameters.
If your filter requires no parameters (and if you have no other reasons to prompt the
user), you can delete the get^cpu^num procedure and the call to it. You can also delete
the DDL file unless your application needs it for other reasons, such as reporting
events.
Tracking Earlier Events
As originally shown, the example retrieves messages as the collector receives them.
The modifications discussed here cause the distributor to begin retrieving event
messages generated four hours earlier and subsequently logged. After retrieving the
logged event messages, the application continues to process event messages as they
arrive.
To provide the application with the means to specify a time (starting position) to the
distributor, insert this procedure after the spi^cmd^load^filter procedure:
?PAGE
PROC spi^cmd^set^position (time);