Using Mapping Services › MDO Behavior and NCL Processing Conventions › Input Operations on an MDO
Input Operations on an MDO
A number of NCL verbs allow input operations on an entire MDO. These are:
- &APPC RECEIVE
- &ASSIGN
- &CNMREAD
- &DECODE
- &ENCODE
- &FILE GET
- &INTREAD
- &LOGREAD
- &MSGREAD
- &PPI RECEIVE
- &PPOREAD
- &VARTABLE GET
When the MDO is targeted for input the MAP operand is allowed to define the mapping of the data object being accessed. The state of the MDO following any such input operation is determined by a number of factors that apply generally to all verbs. Together these considerations produce an MDO behavior which is predictable, as follows.
- If the verb return code indicates that the request was not satisfied, either due to some error, or because no data satisfied the particular request (perhaps due to timeout, or selection criteria or similar), the target MDO is deleted. Subsequent reference to the MDO or its components is invalid, and will produce a name check return code.
- If the verb return code indicates that the request was satisfied, then the target MDO always exists, even if it is null (or empty). If no map name was supplied on the input operation, and no default map name applies, then the MDO is unmapped. If a map name was supplied but either the map could not be found, was in error, or the data did not conform to the map definition, then the map check return code is set with a feedback indicating the nature of the error. If the map was not found, the data is present in the MDO which is unmapped. Otherwise, if no errors are encountered, the MDO will exist and is mapped according to the map name implied.
After performing a successful input operation on an MDO, the &ZMDORC system variable should always be checked to ensure that the outcome was good, and that the MDO is still mapped. Failure to do so can cause the NCL procedure to be terminated if a reference to an MDO component is made, the MDO is unmapped, and &CONTROL MDOCHK is in effect.
However, once the MDO is bound to the map without error, its contents are guaranteed valid by Mapping Services and there is usually no need to check the return codes for every access to MDO components, but they are available if required.