NET/MASTER Network Control Language (NCL) Programmer's Guide
The Structure of Mapped Data Object (MDO) Variables
Working With Mapping Services
106160 Tandem Computers Incorporated 10–17
This example also shows, as with whole MDO variables, that it is generally not useful
to display the contents of an enclosed element such as MSGATTR. As a general rule, it
is only useful to refer to an enclosing element to copy its contents to another variable.
Referring to an enclosing element allows you to copy large blocks of data from one
variable to another. The syntax of the ASSIGN verb that allows you to do this is
discussed later in this section. Enclosed and enclosing elements are discussed later in
this section.
The Data Component of an
Element
The data component of an element follows the header of an element. The component
is conceptually divided into two sections: a fixed length data section and a variable
length data section. Either section may contain a null value. The data component may
consist of other (enclosed) elements inside an outer (enclosing) element or other data
structures called groups and fields. Some enclosed elements can be repeated and are
called repeated elements.
The data component contains data that you can access from an NCL procedure. The
data component which you generally refer to from an NCL procedure is a field.
Figure 10-3 shows part of the structure of an element called MSGATTR in an MDO
variable mapped by the map $MSG.
Enclosing and Enclosed Elements
Some elements—called enclosing elements—may contain other elements—called
enclosed elements. Figure 10-3 shows some of the elements in the MSGATTR element
in an MDO variable mapped by the map $MSG: DISPLAY, FLD and MSGCODE.
MSGATTR is an enclosing element while DISPLAY, FLD, and MSGCODE are enclosed
elements.
An enclosed element is contained entirely within the data component of the enclosing
element. Its length is included as part of the value of the length field of the enclosing
element. Figure 10-3 shows that the elements DISPLAY, FLD and MSGCODE are part
of the data component of MSGATTR. Figure 10-3 also shows that the elements
DISPLAY, FLD and MSGCODE have their own data components.
Since elements can contain further elements, it follows that a hierarchy of elements can
exist. An enclosed element is subordinate in the hierarchy to the element that encloses
it. For example, DISPLAY is subordinate to MSGATTR, FLD is subordinate to
MSGATTR, and MSGCODE is subordinate to MSGATTR.