EMS Manual

Compiled Filters
EMS Manual426909-005
5-28
Declarations
Example 1
This filter selects event messages local to the \ABCD system:
FILTER forward^only^local^events;
BEGIN
IF ZEMS^TKN^SYSTEM = [#SYSTEMNUMBER \ABCD] THEN
PASS
ELSE
FAIL;
END;
Example 2
This filter selects event messages that have a ZEMS^TKN^ACTION^NEEDED token
set TRUE, no matter which subsystem created the message. The #SET command just
before the filter defines the subsystem ID for EMS, namely ZEMS^VAL^SSID, for use
in the filter itself.
[#SET ZEMS^VAL^SSID
[ZSPI^VAL^TANDEM].[ZSPI^SSN^ZEMS].[ZEMS^VAL^VERSION] ]
FILTER ftest;
BEGIN SSID ( ZEMS^VAL^SSID ) -- EMS is default subsystem ID
IF ZEMS^TKN^ACTION^NEEDED = [ZSPI^VAL^TRUE] THEN PASS;
END; -- End of filter specification
Without the subsystem ID, the compiler would treat ZEMS^TKN^ACTION^NEEDED as
a token of the subsystem that created the event message. That error could give
unpredictable false positives.
Example 3
This filter selects certain DNS event messages. The #SET command just before the
filter defines the subsystem ID for DNS, namely ZDNS^VAL^SSID, for use in the filter
itself.
[ #SET ZDNS^VAL^SSID [ZSPI^VAL^TANDEM].[ZSPI^SSN^ZDNS].0 ]
FILTER DNS^NonStop;
BEGIN
IF ZSPI^TKN^SSID = SSID ( ZDNS^VAL^SSID ) AND
( ZEMS^TKN^EVENTNUMBER = [ZDNS^EVT^CHECKPOINT^FAIL] OR
ZEMS^TKN^EVENTNUMBER = [ZDNS^EVT^CHECKOPEN^FAIL] OR
ZEMS^TKN^EVENTNUMBER = [ZDNS^EVT^CREATEBACKUP^FAIL] OR
ZEMS^TKN^EVENTNUMBER = [ZDNS^EVT^BACKUP^DELETED] OR
ZEMS^TKN^EVENTNUMBER = [ZDNS^EVT^RESYNC^FAIL] OR
ZEMS^TKN^EVENTNUMBER = [ZDNS^EVT^TRAP] ) THEN
PASS;
END;
The TACL #SET command is necessary because subsystem IDs are not automatically
initialized when the standard definition files are loaded.