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

The ASSIGN and DROP Verbs
Working With Mapping Services
10–50 106160 Tandem Computers Incorporated
Obtaining Information About Repeated Elements in an MDO Variable
You can obtain information about repeated elements in an MDO variable at the
specified level using the following syntax of the ASSIGN verb:
ASSIGN OPT=MDOCOUNTS
{ ARGS [ RANGE=(
start
,
end
) ] |
VARS={
output-vars-list
|
variable
* }
[ RANGE=(
start
,
end
) ] }
FROM
MDO=
variable-name
The following MSGPROC NCL procedure reads a message and uses the ASSIGN verb
to obtain information about variable components:
zex1023n: PROCEDURE
/* MSGPROC procedure to display information about */
/* variable components in an MDO variable */
DO FOREVER
MSGREAD VARS=&word*
IF &word1 = "TEST" THEN DO
&$msg.msgattr.fld{1}.offset = 8
&$msg.msgattr.fld{1}.length = 8
&$msg.msgattr.fld{1}.color = "TURQUOISE"
&$msg.msgattr.fld{1}.hlite = "BLINK"
&$msg.msgattr.fld{1}.intens = "HIGH"
&$msg.msgattr.fld{2}.offset = 17
&$msg.msgattr.fld{2}.length = 7
&$msg.msgattr.fld{2}.color = "BLUE"
&$msg.msgattr.fld{2}.hlite = "NONE"
&$msg.msgattr.fld{2}.intens = "NORMAL"
ASSIGN OPT=MDOCOUNTS VARS=&mdocounts,
FROM MDO=&$MSG.MSGATTR.FLD
SAY "Occurrences of &$MSG.MSGATTR.FLD is "&mdocounts
MSGCONT
END
ELSE
MSGCONT
END
END zex1023n