EMS Manual
Compiled Filters
EMS Manual—426909-005
5-5
Considerations for Writing Filters
Errors detected: 0
Warnings detected: 0
For more information, see The Filter Compiler on page 5-44. For a working example of
a filter specification, the TAL source of an application, and the DDL file that supports
the filter, see Appendix A, Example of Retrieving Event Messages.
Considerations for Writing Filters
When you write compiled filters, consider several factors to retrieve exactly the event
messages you need while making optimum use of system and network resources, and
to develop a library of filters that are maintainable:
Selectivity
You can exclude large numbers of irrelevant messages if your application can
determine that the messages to be examined are in a restricted time interval. If such
an interval is known, position the distributor to the beginning of the interval. For details,
see the distributor CONTROL command in Section 17, Distributor Commands and
Responses.
To provide an early stop for event-message examination by a consumer distributor,
consider one of these methods:
To make the distributor stop when it reaches the end of the event messages
already logged, include the ZEMS^TKN^EOFSTOP token when sending the
GETEVENT command message. (For more information, see GETEVENT
Command (ZEMS-CMD-GETEVENT) on page 17-25.)
If the application can determine a particular time at which to stop (a log time, for
example), the application can pass that time to the filter as a parameter. The filter
can signal that it has seen a message with such a time by executing a PASS
statement with a special PASS value; a PASS 0 statement, for example. This
strategy can save significant computer time. The special PASS value tells your
application to stop sending GETEVENT command messages, so the filter does not
execute a FAIL statement for each event message from the stop time to the end of
the log files.
If a compiled filter is to select messages from one subsystem only, or if the filter has a
compound statement for selecting those messages, place an IF statement near the
beginning of the filter or the compound statement to exclude messages from other
subsystems.