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

The ASSIGN and DROP Verbs
Working With Mapping Services
106160 Tandem Computers Incorporated 10–35
The following NCL procedure uses the ASSIGN verb to create an MDO variable,
&ABC., that is interpreted by the map $MSG:
zex1013n: PROCEDURE
/* Assigns data to an MDO variable */
ON ERROR DO
SAY "An error has occurred"
SAY "Line is "&SYS.ERROR.LINE
SAY "Statement is "&SYS.ERROR.STMT_NAME
SAY "Condition is "&SYS.ERROR.COND
SAY "Assigning a new value to variable"
IF &SYS.ERROR.STMT_NAME = "WRITE" THEN
ASSIGN MDO=&abc. MAP=$MSG DATA=’00080001’x’WXYZ’
RETRY
END
SAY Creating an MDO variable with map $MSG
ASSIGN MDO=&abc. MAP=$MSG DATA=ABCD
SAY "&ABC. is "&abc.
WRITE DATA="&ABC.TEXT is "&abc.text
END zex1013n
The NCL procedure assigns data, ABCD, to the variable &ABC. and displays the
contents of the variable. It then attempts to display the contents of the TEXT field,
using the WRITE verb. However, Mapping Services raises an error because it cannot
interpret the values of &ABC.TEXT. according to the map definition for the TEXT
element. The error handler then assigns data—’00080001’x’WXYZ’—to the variable.
(The characters 0008 represent a hexadecimal number with the length of the element
and the characters 0001 represent a hexadecimal number with the key value of the
element.) The NCL procedure is then able to successfully display the contents of the
variable.