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

The ASSIGN and DROP Verbs
Working With Mapping Services
10–44 106160 Tandem Computers Incorporated
Obtaining Element Names in a Map
You can obtain the names of the elements defined in a map at the specified level using
the following syntax of the ASSIGN verb:
ASSIGN OPT=MAPELEMENTS
{ 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 element names:
zex1019n: PROCEDURE
/* MSGPROC procedure to trap a message and display */
/* element names in a map */
DO FOREVER
MSGREAD VARS=&word*
IF &word1 = "TEST" THEN DO
ASSIGN OPT=MAPELEMENTS VARS=&mapelements*,
FROM MDO=&$MSG.
SAY "Elements in map $MSG are"
DO &i = 1 TO &SYS.VARCNT
SAY &mapelements&i
END
MSGCONT
END
ELSE
MSGCONT
END
END zex1019n