NET/MASTER Network Control Language (NCL) Reference Manual

INTREAD
Verbs
3–114 106126 Tandem Computers Incorporated
For the interpretation of Message Profile Variables contained in MDOs, see
Section 7, “Message Profile Variables.”
For more information on the INTREAD verb, refer to the NonStop NET/MASTER
NCL Programmer's Guide, which also contains examples of the use of the INTREAD
verb.
Examples
The following example requests the first message from the dependent response queue,
specifying that it is to be split into variables &20 to (a maximum of) &80:
INTREAD WAIT=5 ARGS RANGE=(20,80)
In the preceding example, &SYS.VARCNT is set to indicate how many variables were
created. If no message is available within five seconds, control returns and the
&SYS.FDBK system variable is set to 4.
The following example reads the next message from the dependent response queue
and splits the message into individual words:
INTREAD VARS=(*(3),&A(2),&B(3),&C,&D,&E,&F)
In the previous example, *(3) specifies that the first three words are ignored. Two
characters of the next word are placed in the variable &A. Three characters of the next
word are placed in the variable &B. The next four words are placed in variables &C,
&D, &E, and &F respectively. See Section 11, “Verb and Variable Access Methods,”
for parsing methods used by NCL.
The following example reads the next message from the dependent request queue,
splits it, and places the text into a series of automatically generated variables of the
form &ABC1, &ABC2, …, &ABC50. As many variables as required are generated, to
the limit (50) specified by RANGE:
INTREAD VARS=&ABC* RANGE=(1,50) TYPE=REQ
The following example reads the next message from the dependent response queue,
splits it and places the enclosed MDO into a newly created MDO variable,
&XXXXMDO.:
INTREAD MDO=&XXXXMDO. WAIT=YES TYPE=RESP
In the previous example, it is assumed that the global variable &GLBLID contains the
NCL ID of the procedure that issues the INTREAD verb, and that a message has been
created by the WRITE verb in the following manner:
ASSIGN MDO=&USERMDO. MAP=$MSG
&USERMDO.TEXT= X Y Z
WRITE NCLID=&GLBLID MDO=&USERMDO. DATA=A B C
The result after executing the preceding two code segments in two separately
executing NCL procedures is that the variable &XXXXMDO.TEXT contains the string
“X Y Z”, the variable &$INT.TEXT contains the string “A B C”, and the map name is
$MSG.