EMS Manual

Retrieving Event Messages Interactively
EMS Manual426909-005
3-3
Creating Simple Compiled Filters
Creating Simple Compiled Filters
A printing distributor needs a filter to specify which event messages to print and which
to ignore. If you do not specify a filter, it uses its default filter, which passes all event
messages.
To try running a printing distributor with another filter if you do not have access to a
filter object file (a compiled filter specification), either write your own or try one of these
simple compiled filters:
Pass only critical event messages:
FILTER critical;
BEGIN
IF ZEMS^TKN^EMPHASIS = [ZSPI^VAL^TRUE] THEN PASS;
END; --ELSE FAIL is implied
Pass all event messages from a specific subsystem (Pathway, in this example):
FILTER passpwy;
BEGIN
--initialize SSD structure
--(Note: Pathway must be installed for this to work
[ #set ZPWY^VAL^SSID TANDEM.PATHWAY.C00 ]
--pass if SSID = PATHWAY
IF ZSPI^TKN^SSID = SSID(ZPWY^VAL^SSID) THEN PASS;
END; --ELSE FAIL is implied
To create these compiled filters, copy the previous filter-language statements to two
EDIT files, one for each filter. For example, you could name the files SCRIT and
SPWY. (S stands for source for filter.) Then pass the EDIT files to the EMF (filter
language) compiler. These TACL statements load the necessary SPI definitions and
compile the two filters into object files called FCRIT and FPWY:
PUSH X
#LOAD / KEEP 1, LOADED X / $SYSTEM. ZSPIDEF.ZSPITACL
#LOAD / KEEP 1, LOADED X / $SYSTEM. ZSPIDEF.ZEMSTACL
#LOAD / KEEP 1, LOADED X / $SYSTEM. ZSPIDEF.ZPWYTACL
POP X
EMF /IN SCRIT/ FCRIT
EMF /IN SPWY/ FPWY
You could also use this ATTACHSEG TACL command:
ATTACHSEG SHARED $SYSTEM.ZSPISEGF.ZxxxTACL :Zxxx
#SET #USELIST [#USELIST] :Zxxx
Zxxx could be any of ZSPI, ZEMS, or ZPWY.
After you have a compiled filter specification, direct the distributor to load that filter by
including the FILTER parameter and specifying the file name of the compiled filter:
EMSDIST TYPE PRINTING, COLLECTOR $0, FILTER FCRIT,
TEXTOUT [ #MYTERM ]