NET/MASTER Network Control Language (NCL) Programmer's Guide

The Standard Map $SPI
Standard and User-Defined Maps
106160 Tandem Computers Incorporated 11–19
Detecting a Message With
SPI Tokens
After you read a message using the EMSREAD, INTREAD, LOGREAD, or MSGREAD
verb, you can easily detect whether it contains SPI tokens. If a message does not
contain SPI tokens, the SPI element is not present in the message. Conversely, if a
message does contain SPI tokens, the SPI element is present in the message. The
following IF statement detects whether a message contains SPI tokens after it is read
by the EMSREAD verb:
IF &$EMS.SPI. \= "" THEN
SAY SPI tokens are present in this message
ELSE
SAY SPI tokens are not present in this message
Accessing SPI Tokens
From NCL
The following three NCL procedures show how you can easily access the data in the
SPI portion of an MDO variable.
The first NCL procedure is an EMSPROC procedure called ZEX1101N. It is designed
to allow all messages that arrive at your NonStop NET/MASTER MS system to pass
through unchanged.
The second NCL is a MSGPROC procedure called ZEX1102N. It is designed to trap
messages that contain SPI tokens and have TEST in the message text, and to analyze
and display their contents.
The third NCL procedure is an NCL procedure called ZEX1103N. It uses the NCL
EMSSEND verb to send a message to your Event Management Service (EMS) collector.
To see how these NCL procedures work, follow these steps:
1. Type the first NCL procedure as shown, calling it ZEX1101N:
zex1101n: PROCEDURE
/* EMSPROC procedure */
SAY EMSPROC starting
DO FOREVER
EMSREAD
EMSCONT
END /*do*/
END zex1101n
2. Copy ZEX1101N to your customized procedure library.
3. Install ZEX1101N as your EMSPROC procedure using the following SYSPARMS
command from the OCS command input line:
SYSPARMS EMSPROC=ZEX1101N
Flushing your current EMSPROC procedure using the SYSPARMS
EMSPROC=FLUSH command achieves the same result, since this allows all EMS
messages to pass through. You can use the SHOW SYSPARMS command or the
STATUS command to confirm that ZEX1101N is now your active EMSPROC
procedure.