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

The Standard Map $SPI
Standard and User-Defined Maps
11–20 106160 Tandem Computers Incorporated
4. Type the second NCL procedure as shown, calling it ZEX1102N:
zex1102n: PROCEDURE
/* MSGPROC procedure to analyze and filter messages with */
/* SPI tokens */
DO FOREVER
/* Read message into a single variable */
MSGREAD VARS=&message PARSE=NO
/* See if message text contains TEST */
&found = POS(TEST,&message)
SELECT
/* SPI tokens present and contains TEST */
WHEN &$msg.spi \= "" AND &found > 0 THEN DO
ASSIGN OPT=MDOELEMENTS VARS=&mdoelements*,
FROM MDO=&$MSG.SPI.TANDEM
SAY "Elements under &$MSG.SPI.TANDEM are"
DO &i = 1 TO &SYS.VARCNT
SAY &mdoelements&i is &$msg.spi.tandem.&mdoelements&i
END
MSGCONT COLOR=BLUE INTENS=LOW HLITE=BLINK
END
/* SPI tokens present but does not contain TEST */
WHEN &$msg.spi \= "" AND &found <= 0 THEN
MSGDEL
OTHERWISE
MSGCONT
END
END
END zex1102n
5. Install ZEX1102N as your active MSGPROC procedure using the following
command from the OCS command input line:
PROFILE MSGPROC=ZEX1102N
6. Type the third NCL procedure as shown, calling it ZEX1103N:
zex1103n: PROCEDURE
/* Sends a message to the EMS collector */
SAY "Sending a message to the EMS collector"
ASSIGN MDO=&abc. MAP=$MSG
&abc.text = TEST Hello world from &SYS.USER.ID
&abc.msgattr.display.color = WHITE
&abc.msgattr.display.hlite = HIGH
&abc.spi.tandem.zspi_tkn_ssid = TANDEM.NNM.D30
&abc.spi.tandem.zems_tkn_subject_mark = "TANDEM.ZEMS_TKN_TEXT{1}"
&abc.spi.tandem.zems_tkn_text = TEST Hello world from &SYS.USER.ID
&abc.spi.tandem.zems_tkn_eventnumber.# = 9999
EMSSEND MDO=&abc.
END zex1103n