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

The ASSIGN and DROP Verbs
Working With Mapping Services
106160 Tandem Computers Incorporated 10–47
Obtaining Element Names in an MDO Variable
You can obtain the names of the elements present in an MDO variable at the specified
level using the following syntax of the ASSIGN verb:
ASSIGN OPT=MDOELEMENTS
{ ARGS [ RANGE=(
start
,
end
) ] |
VARS={
output-vars-list
|
variable
* }
[ RANGE=(
start
,
end
) ] }
FROM
MDO=
variable-name
Only the names of those elements present within the specified MDO variable are
returned.
The following MSGPROC NCL procedure reads a message and uses the ASSIGN verb
to obtain the names of the elements that are present:
zex1021n: PROCEDURE
/* MSGPROC procedure to trap a message and display */
/* elements names in an MDO variable */
DO FOREVER
MSGREAD VARS=&word*
IF &word1 = "TEST" THEN DO
ASSIGN OPT=MDOELEMENTS VARS=&mdoelements*,
FROM MDO=&$MSG.
SAY "Elements under &$MSG. are"
DO &i = 1 TO &SYS.VARCNT
SAY &mdoelements&i
END
MSGCONT
END
ELSE
MSGCONT
END
END zex1021n