EMS Manual

Example of Retrieving Event Messages
EMS Manual426909-005
A-15
TACL Source File
]
== Initialize SSID for MYAP
[#IF [#MATCH [myap^val^ssid] 0.0.0] |THEN|
#SET myap^val^ssid &
[MYAP^VAL^OWNER].[MYAP^SSN^MYAP].[MYAP^VAL^VERSION]
]
#PUSH distr_request distr_reply distr_error
#DEF bell STRUCT BEGIN CHAR c; BYTE b REDEFINES c; END;
#SET bell:b 7 == ASCII value for BEL character.
#PUSH emphasis == Tells if event should be emphasized.
#PUSH distr^name
#PUSH cpu^num
#PUSH spi^err, used^len, ems^err
#DEF spi^buf STRUCT LIKE zems^ddl^msg^buffer;
#DEF sav^buf STRUCT LIKE zems^ddl^msg^buffer;
== This routine gets and checks the CPU number ------------
[#DEF get^cpu^num ROUTINE |BODY|
#RESULT &
[#CASE [#ARGUMENT/VALUE cpu^num/ NUMBER OTHERWISE]
|1| [#IF cpu^num >= 0 and cpu^num <= 15 |THEN| -1
|ELSE| 0]
|2| 0
]
] {get^cpu^num}
== End of get^cpu^num -------------------------------------
[#DEF spi^control TEXT |BODY|
== Initialize spi^buf for distributor CONTROL command
#SET spi^err [
#SSINIT spi^buf [zems^val^ssid] ZEMS^CMD^CONTROL ]
[#IF spi^err |THEN|
*** [spi^err] on #SSINIT of CONTROL command]
== Place the connect-source-collector token in buffer.
#SET spi^err [
#SSPUT spi^buf ZEMS^TKN^CONNECT^SRC^COLL $0]
[#IF spi^err |THEN|
*** [spi^err] on #SSPUT of CONNECT^SRC^COLL]
== Place the load-filter-from-file token in the buffer.
#SET spi^err [#SSPUT spi^buf ZEMS^TKN^FILTERFILE
$system.filt.myapfobj]
[#IF spi^err |THEN|
*** [spi^err] on #SSPUT of FILTERFILE]
== Place the filter-parameter token in the buffer.
#SET spi^err [#SSPUT /SSID [myap^val^ssid]/