NET/MASTER Network Control Language (NCL) Programmer's Guide
Sending a Message to EMSPROC
Developing System-Level NCL Procedures
106160 Tandem Computers Incorporated 17–23
4. Type the second NCL procedure as shown, calling it ZEX1707N:
zex1707n: 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
 SAY "&$MSG.TEXT is "&$msg.text
 SAY "&$MSG.SPI.TANDEM.ZEMS_TKN_EVENTNUMBER.# is",
 &$msg.spi.tandem.zems_tkn_eventnumber.#
 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 zex1707n
5. Install ZEX1707N as your active MSGPROC procedure using the following
command from the OCS command input line:
PROFILE MSGPROC=ZEX1707N
6. Type the third NCL procedure as shown, calling it ZEX1708N:
zex1708n: PROCEDURE
 /* Sends a message to EMSPROC */
 SAY "Sending a message to EMSPROC"
 ASSIGN MDO=&abc. MAP=$MSG
 &abc.text = "TEST This is the &ABC.TEXT text"
 &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 This is the &ABC.SPI.TANDEM.ZEMS_TKN_TEXT text"
 &abc.spi.tandem.zems_tkn_eventnumber.# = 9999
 EMSALERT MDO=&abc.
END zex1708n










