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

Sending a Message Between NCL Processes Using the WRITE Verb
Environments and Command Processing
16–46 106160 Tandem Computers Incorporated
Specifying Ordinary Variables When Reading a Message
The following two NCL procedures show how to use the WRITE verb to send text
from one NCL process to a target NCL process that specifies ordinary variables when
reading a message. To see how these NCL procedures work, follow these steps:
1. Type the first NCL procedure as shown, calling it ZEX1616N:
zex1616n: PROCEDURE
/* Analyzes messages on the dependent response queue */
/* sent by the WRITE verb from another NCL process */
ON ERROR DO
&glblzex1616n = ""; FLUSH
END /*on*/
/* Uses a global variable to store the NCL ID */
&glblzex1616n = &SYS.NCLID
SAY "NCL ID of ZEX1616N is "&SYS.NCLID
DO FOREVER
INTREAD ARGS WAIT=YES TYPE=RESP
DO &cvar = 1 TO &SYS.VARCNT
SAY "&"&cvar" is "&&cvar
END /*do*/
IF &$int.usermdo \= "" THEN DO
SAY "This message has a USERMDO"
/* Copy MDO in USERMDO to &MDO. mapped */
/* by map in MAPNAME */
ASSIGN OPT=VALUE MDO=&mdo. MAP=&$int.mapname,
DATA=&$int.usermdo
END /*do*/
ELSE DO
SAY "This message does not have a USERMDO"
/* Copy &$INT. to &MDO. mapped by $MSG */
ASSIGN OPT=VALUE MDO=&mdo. MAP=$MSG,
FROM MDO=&$int.
END /*do*/
SAY "&$INT.TEXT is "&$int.text
SAY "&$INT.USERMDO is "&$int.usermdo
SAY "&$INT.MAPNAME is "&$int.mapname
SAY "Elements and fields in &MDO. are"
CALL show_mdo( 0, "" ) SHARE &mdo.
INTCONT
END /*do forever*/
EXIT
show_mdo: PROCEDURE
/* Procedure to display all elements and fields */
/* in an MDO variable regardless of its map */
&nspaces = &1
&piece = &2
&spaces = COPIES( " ", &nspaces )
IF &piece \== "" THEN
&piecedot = &piece"."