EMS Manual

Example of Reporting Events
EMS Manual426909-005
B-11
The TACL Source File
END;
]
== Define other variables
#PUSH in^msg start^io end^io io^time emphasis io^calls evt^calls evt^txt
=============================================================
== Build XOUR^EVT^TIME^TOO^LONG event and send it to the collector.
==
[#DEF too^long TEXT |BODY|
== Set up XOUR^TKN^IO^FILE token value. This token is the subject
== of the event number XOUR^EVT^TIME^TOO^LONG.
#DEF in^fname STRUCT LIKE zspi^ddl^fname;
#SET in^fname [#IN]
== Initialize buffer
#SET ems^err [#EMSINITV event^buf [OUR^SSID] XOUR^EVT^TIME^TOO^LONG
XOUR^TKN^IO^FILE in^fname]
[#IF ems^err |THEN|
*** #EMSINITV error: [ems^err]
]
== Fill in values for XOUR^TKN^IO^MSG
== The format is the string length followed by the text string.
== Because the first character in in^msg may be numeric, we need
== to separate the string length and the in^msg by using
== stringdata STRUCT.
#SET stringdata [#CHARCOUNT in^msg] [in^msg]
#SET ems^err [#SSPUTV event^buf XOUR^TKN^IO^MSG stringdata]
[#IF ems^err |THEN|
*** #SSPUTV error: [ems^err]
]
== Fill in values for XOUR^TKN^IO^TIME
#SET ems^err [#SSPUT event^buf XOUR^TKN^IO^TIME [io^time]]
[#IF ems^err |THEN|
*** #SSPUT error: [ems^err]
]
== Fill in values for ZEMS^TKN^EMPHASIS
[#IF io^time > 30000000 |THEN| #SET emphasis [zspi^val^true]
|ELSE| #SET emphasis [zspi^val^false]
]
#SET ems^err [#SSPUT event^buf ZEMS^TKN^EMPHASIS [emphasis]]
[#IF ems^err |THEN|
*** #SSPUT error: [ems^err]
]
== Add a map token in the buffer.
[#DEF too^long^stats STRUCT LIKE xour^ddl^too^long^stats;]
#SET ems^err [#SSNULL xour^map^too^long^stats too^long^stats]
[#IF ems^err |THEN|
*** #SSNULL error: [ems^err]
]
#SET too^long^stats:subsys^process^type [xour^val^proc^output^bound]
#SET too^long^stats:ios [io^calls]
#SET evt^calls [#COMPUTE [evt^calls] + 1]
#SET too^long^stats:occurrences [evt^calls]
[#SET ems^err
[#SSPUTV event^buf xour^map^too^long^stats too^long^stats]
]
[#IF ems^err |THEN|