NET/MASTER Network Control Language (NCL) Programmer's Guide
Sending a Message Between NCL Processes Using the WRITE Verb
Environments and Command Processing
106160 Tandem Computers Incorporated 16–47
ASSIGN OPT=MDOELEMENTS ARGS FROM MDO=&mdo.&piece
DO &i = 1 TO &SYS.VARCNT
&y = &piecedot || &&i
SAY &spaces || Element &&i is &mdo.&y
CALL show_mdo( &nspaces + 2, &y ) SHARE &mdo.
END
ASSIGN OPT=MDOFIELDS ARGS FROM MDO=&mdo.&piece
DO &i = 1 TO &SYS.VARCNT
&y = &piecedot || &&i
SAY &spaces || Field &&i is &mdo.&y
CALL show_mdo( &nspaces + 2, &y ) SHARE &mdo.
END
END show_mdo
END zex1616n
This procedure is designed to loop forever to trap messages arriving on its
response queue and to analyze their contents. The INTREAD verb specifies
ordinary variables when reading a message. The message is analyzed to
determine whether it contains an enclosed MDO variable. Information about the
message is then displayed on the screen.
2. Type the second NCL procedure as shown, calling it ZEX1617N:
zex1617n: PROCEDURE
/* Sends text to an NCL process */
/* Wait until ZEX1616N begins execution */
DO UNTIL &glblzex1616n \= ""
DELAY 1
END /*do*/
WRITE COLOR=WHITE,
NRD=OPER,
NCLID=&glblzex1616n,
DATA=a b c
END zex1617n
This procedure sends text to the NCL process whose NCL ID is in the
&GLBLZEX1616N global variable.
Note The use of global variables is not recommended in a production environment since it may impede the
performance of NonStop NET/MASTER MS.
3. Execute ZEX1616N from the OCS command input line, using the following START
command:
START ZEX1616N
When executed, ZEX1616N places its NCL ID in the &GLBLZEX1616N global
variable.
4. Execute ZEX1617N from the OCS command input line, using the following START
command:
START ZEX1617N