EMS Manual

Example of Retrieving Event Messages
EMS Manual426909-005
A-5
Filter Source File
Filter Source File
This file contains filter source statements:
== File name: MYAPFSRC
[#SET myap^val^ssid
[myap^val^owner].[myap^ssn^myap].[myap^val^version]]
FILTER cpu^param (SSID(myap^val^ssid, myap^tkn^param^cpu));
== FILTER cpu^param (myap^tkn^param^cpu);
BEGIN
IF ZEMS^TKN^CPU = myap^tkn^param^cpu THEN PASS;
END;
TAL Source File
This file contains the TAL source statements:
! File name: MYAPMAIN ---------------------------------------
!
! The MYAP application does the following:
!
! - Starts and opens a consumer distributor
!
! - Prompts you at your terminal for a CPU number
!
! - Issues CONTROL command messages to
!
! connect the collector $0
! load a filter file
! load a filter param
! (cpu-number from user)
!
! - Performs the following steps in a loop:
! -- Issues a GETEVENT command message
! -- Displays an event message at your terminal
!
! MYAP waits for new events from the given CPU and displays
! them as they arrive.
!
! To terminate the program, press the BREAK key
! and type STOP.
!
! The filter file must be $SYSTEM.FILT.MYAPFOBJ.
!
?NOMAP,NOLMAP
?INSPECT,SYMBOLS
?EXTENDSTACK 4 ! To ensure enough stack space for EMSTEXT
?NOCODE
?NOLIST, SOURCE $SYSTEM.ZSPIDEF.ZSPITAL
?LIST
?NOLIST, SOURCE $SYSTEM.ZSPIDEF.ZEMSTAL
?LIST