Once an MDO is connected to a map, it is possible to query its structure (as present in the MDO), or its definition (as defined in the map). The syntax used is part of an &ASSIGN, where the results of the query must be placed into NCL variables.
&ASSIGN OPT={ NAMES
|TAGS
|TYPE
|LENGTH
|#ITEMS
|NAMEDVALUES
|VALIDVALUES }
VARS=vars...
{ PRESENT_IN | DEFINED_IN | MANDATORY }
MDO=mdoName
When the PRESENT_IN keyword is specified the information is returned only for those components that are found to be present within the MDO. When the DEFINED_IN keyword is used, the information is returned for all those components defined within the connected map, regardless of their presence or absence in the MDO itself. If the MANDATORY keyword is used then only those defined components that are mandatory are selected.
The various options and their meanings are as follows:
Applies to PRESENT_IN, DEFINED_IN and MANDATORY options and returns the component names associated with the target mdoName as follows:
A compound variable indexed name (for example, MDO=a.b{*}.c, or MDO=a.b.{*}) is not supported on this query.
Applies to PRESENT_IN, DEFINED_IN and MANDATORY options and returns the component tags used by Mapping Services associated with the target mdoName. Component selection is as for OPT=NAMES.
Applies to PRESENT_IN, DEFINED_IN and MANDATORY options and returns the component type defined within the map and associated with the target mdoName. Component selection is as for OPT=NAMES.
Applies only when PRESENT_IN is specified and returns the local form data length within the MDO of the target component(s). Component selection is as for OPT=NAMES.
Applies only when PRESENT_IN is specified, and returns the number of items within a nominated component as follows:
Otherwise it provides the number of components present within the structure a.b.c.
Applies to components that have named values associated with their type. These types are limited to BIT STRING, INTEGER, and ENUMERATED. Other types will return null results. No generic indexes or generic names are allowed on this option.
If DEFINED_IN is specified a list of the named values defined in the map for the specified component is returned.
Applies to string types that can have their character set constrained to particular characters or strings. It only works in conjunction with the defined keyword. If a string type (for example, GraphicString) has been constrained to a particular set of characters or strings, then this option returns the valid characters or strings in the target variable. If there are no constraints then no values are returned on assignment. The &ZVARCNT system variable is set to indicate the number of target variables set by the assignment.
Example 1: Query MDO Components
If there is a component defined as follows:
datax GraphicString ("ABCD" | "xyz" | "QQQ")
then &ASSIGN VARS=X* OPT=VALIDVALUES DEFINED MDO=... datax will return 3 variables set as follows:
&X1=ABCD &X2=xyz &X3=QQQ
Example 2: Query MDO Components
If there is a component defined as follows:
datax GraphicString (FROM ( "A"c | "C" | "Y"C | "X" ))
then &ASSIGN VARS=X* OPT=VALIDVALUES DEFINED MDO=... datax will return 4 variables set as follows:
&X1=A &X2=C &X3=Y &X4=X