EMS Manual

Compiled Filters
EMS Manual426909-005
5-3
Creating a Compiled Filter
You can supplement the filter language facilities with your own TACL
commands and macro invocations. During filter compilation, TACL expands
any text in the filter source that is surrounded by brackets ([]).
A TOKENPRESENT function, which returns TRUE or FALSE, depending on
whether the current event message contains the specified token
A LITERALLY function, which makes comparisons case-sensitive, overriding the
standard comparison convention, which is to ignore case
Relational operators ( =, <>, >, >=, <, and <= ), which allow comparisons between
token values and constants
Boolean operators (AND, OR, and NOT) and Boolean expressions
Boolean variables and assignment statements
IF-THEN-ELSE and compound statements
Sample Filter Specification
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;
The filter specification does not declare the token name ZEMS^TKN^SYSTEM,
because—like all names used by the EMS subsystem—it is defined in the standard
definition file for EMS, $SYSTEM.ZSPIDEF.ZEMSTACL. For details, see Loading
Standard Definitions on page 5-4.
The brackets that surround the #SYSTEMNUMBER macro-call direct TACL to expand
the enclosed text. This expansion occurs during filter compilation, not during filter
execution. In the filter listing, the brackets and their contents are replaced by a
constant (116, in this case), the system number of \ABCD.
Creating a Compiled Filter
To create a compiled filter:
1. Identify the conditions that event messages must meet for the task at hand.
2. Create an EDIT file in the Event Management Service filter (EMF) language that
describes these conditions. This is the filter specification.
3. Compile the filter specification to create the filter, which is returned in an object file.