NET/MASTER Network Control Language (NCL) Reference Manual

EMSREAD
Verbs
3–64 106126 Tandem Computers Incorporated
Examples
The following example waits for and reads the next EMS message, then splits it into
variables &20 through &80. The &SYS.VARCNT system variable is set to indicate how
many variables were created:
EMSREAD ARGS RANGE=(20,80)
The following example waits for and reads the next EMS message, then splits it into
individual words, placing them in the variables &A, &B, &C, &D &E, and &F. If there
is no message outstanding at the time this verb is issued, control returns immediately
to the next statement (not shown):
EMSREAD VARS=(&A,&B,&C,&D,&E,&F) WAIT=NO
The following example filters and displays messages from various subsystems in
distinctive colors. It shows a complete EMSPROC NCL procedure (named EPROC2)
containing a DO loop that issues an EMSREAD and follows it with an EMSCONT:
EPROC2: PROCEDURE
/* EMSPROC to display various subsystem events in */
/* distinctive colors */
SAY EMSPROC STARTING
DO FOREVER
EMSREAD
IF &$EMS.SPI \= "" THEN DO
/* Get the owner, subsystem, and version,
number from the SSID */
PARSE VARS=(&OWNER,&SUBSYS,&VERSION),
DELIM='.' DATA=&$ems.spi.zspi_tkn_ssid
SELECT
WHEN &OWNER = TANDEM AND &SUBSYS = EMS THEN
EMSCONT COLOR=RED
WHEN &OWNER = TANDEM AND &SUBSYS = NNM THEN
EMSCONT COLOR=PINK
WHEN &OWNER = TANDEM AND &SUBSYS = PATHWAY THEN
EMSCONT COLOR=TURQUOISE
WHEN &OWNER = TANDEM AND &SUBSYS = SNAX THEN
EMSCONT COLOR=YELLOW
WHEN &OWNER = TANDEM AND &SUBSYS = DSNM THEN
EMSCONT COLOR=WHITE
OTHERWISE
EMSCONT
END /*select*/
END /*do*/
ELSE
EMSCONT
END /*do forever */
END EPROC2