EMS Manual
Compiled Filters
EMS Manual—426909-005
5-7
The Filter Language
When checking the subsystem ID of an event message, use the SSID function—
which ignores the version—as in this example:
IF NOT ( ZSPI^TKN^SSID = SSID(ZPWY^VAL^SSID) ) THEN FAIL;
Correctness
To help you write accurate compiled filters:
Check that the event messages come from the correct subsystem. That is, begin
the filter with an IF statement to exclude any event messages whose main
subsystem ID (the value of the ZSPI^TKN^SSID token) is not the one you want.
Then check for tokens you know the subsystem has placed in the message.
When searching for a token, you must know the subsystem ID that qualifies the
token within the message. You must inform the filter of this subsystem ID: the
subsystem ID that you would pass to the EMSGET procedure to get the token from
an application. Most event-message tokens are qualified by one of two subsystem
IDs:
Subsystems place most tokens in their event messages without explicit
subsystem-ID qualification. Such tokens are implicitly qualified, by the
subsystem ID of the subsystem that generated the message. In the filter, you
can refer to such tokens by simple (unqualified) names.
You can also refer to any header tokens by simple names because header
tokens are shared by all subsystems.
The subsystem might place some tokens in the event message qualified by the
subsystem ID of EMS. Certain tokens, such as
ZEMS^TKN^ACTION^NEEDED, are defined by EMS but used by other
subsystems. (ZEMS^TKN^ACTION^NEEDED is not a header token.) You can
refer to these tokens in a filter in two ways:
Explicitly qualify the token name by the subsystem ID for EMS:
IF SSID ( ZEMS^VAL^SSID, ZEMS^TKN^ACTION^NEEDED) &
= -1 THEN ...
Place the unqualified token name in a compound statement that starts:
BEGIN SSID ( ZEMS^VAL^SSID )
The Filter Language
This subsection provides detailed information about the filter language used with
compiled filters, which lets you select some event messages and screen out others.
For an introduction to using the filter language and the filter compiler, see Writing and
Compiling Filters on page 5-1. For a description of how to produce an object filter
program from a filter specification, see The Filter Compiler on page 5-44. For