EMS Manual

Example of Retrieving Event Messages
EMS Manual426909-005
A-18
TACL Source File
ZSPI^TKN^CONTEXT]
== If no CONTEXT token, we are at end
[#IF spi^err = ZSPI^ERR^MISTKN |THEN|
#UNFRAME
#RETURN
]
[#IF spi^err |THEN|
*** [spi^err] on #SSMOVE of CONTEXT]
== Move updated command to spi^buf for next time
== through loop
#SETBYTES spi^buf sav^buf
] == WHILE
#UNFRAME
] {getevent^loop}
== End of getevent^loop -----------------------------------
== This is the main program -------------------------------
== Start the distributor process
$SYSTEM.SYSTEM.EMSDIST/NAME, NOWAIT/ TYPE CONSUMER
#SET distr^name [#PROCESS]
== Open the distributor for command and response messages
#SET distr_error [#REQUESTER /WAIT [zems^val^buflen]/
READ [distr^name].#ZSPI
distr_error
distr_reply
distr_request]
[#IF distr_error |THEN|
*** [distr_error] Opening distributor [distr^name]]
== Prompt user for the CPU number
[#LOOP |WHILE| NOT [get^cpu^num [#INPUT CPU number?: ]]
|DO| ]
== Send CONTROL command message to manage the distributor
spi^control
== Send GETEVENT command messages, display event messages
getevent^loop
#UNFRAME {myap}