NCL procedures are written to access data through one or more of the standard NCL verbs. When data is provided by one of the verbs that support Mapping Services, the procedure can request that it be treated as an MDO. It provides a name for the MDO, and (optionally) the name of a map that can be used to interpret the data.
Once the data has been internally accessed, and before the NCL verb completes, Mapping Services makes a connection between the MDO and the designated map. The NCL procedure can then reference data components within the MDO using the symbolic names defined in the map.
Example: NCL Procedure
The following example shows how the three components interact in NCL.
&ASSIGN MDO=file1rec MAP=file1map
-* the map called file1map is attached
-* to the MDO called file1rec.
-* This statement indicates to Mapping
-* Services that this map is to be used
-* to interpret any data in the MDO.
&FILE OPEN ID=FILE1 FORMAT=MAPPED MAP=file1map
-* Open file in mapped processing mode.
&FILE GET ID=FILE1 KEY='00000000' MDO=file1rec
-* Read a record from the
-* file into the MDO.
&ASSIGN VARS=A FROM MDO=file1rec.luname
-* Locate a component within the MDO
-* data and copy its contents into the
-* variable &A.
-* Mapping Services uses the map to find
-* out how to locate and recognize the
-* structure referred to as luname-* within NCL.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |