Previous Topic: Overview

Next Topic: Input Operations on an MDO

MDO Behavior and NCL Processing Conventions

After using any verb that references an MDO, the MDO return code (&ZMDORC) and feedback (&ZMDOFDBK) system variables are set. Therefore, check most verbs when using operations involving MDOs.

Because &ASSIGN is used more frequently to process MDO data, an alternative exists. If &CONTROL MDOCHK is in effect, any error situations that normally result in a return code of 8 or higher cause the NCL procedure to terminate, but only if &ASSIGN sets the return code or feedback variable.

If &FILE GET MDO=xxx sets &ZMDORC to greater than 8, the process will not terminate if &CONTROL MDOCHK is in effect. However, if the default &CONTROL NOMDOCHK is in effect, all error checks are reported through the return code and feedback values.

The possible values of the return code and feedback system variables and their meanings are shown in the following table.

&ZMDORC

&ZMDOFDBK

Meaning

0

0

ok

4

0

null: optional component present but empty, or null data assigned to optional component

 

1

null: optional component not present

 

2

null: mandatory component present but empty, or null data assigned to mandatory component

 

3

null: mandatory component not present

 

4

string was truncated (applies to FIX offset or length components only)

8

0

type check: data is invalid for type

 

1

data check: data is invalid structurally -a common cause is data too long or too short

12

0

name check: component not defined

 

1

name check: index position invalid or value is out of range

16

0

map check: map not found

 

1

map check: map contains errors, load failed

 

2

map check: map/data mismatch

To minimize the use of these return codes it is necessary to understand the general behavior of MDOs with NCL.

An &ZMDORC value of 0 means that the data referenced was of a valid type for the component referenced. On assignment, the data is formatted and placed in the target component, resulting in an &ZMDOFDBK value of 0.

An &ZMDORC value of 4 is returned when an MDO component has a null, or empty, value (unless it was the NULL type in which case &ZMDORC is 0). Any component, regardless of its type, can be set to a null value. &ZMDORC is also set to 4 when a string type is truncated and an &ZMDOFDBK value of 4 is returned, but only if it is a fixed-length component.

An &ZMDORC value of 8 is returned if &CONTROL NOMDOCHK is in effect, and the data referenced does not conform to the type of the component referenced or cannot be assigned for other reasons. In exceptional circumstances, a type check or data check can result on a read intent operation. More usually, however, it occurs on an update intent operation where the data being assigned is invalid for the data type and a type check results. If on an update operation the function cannot be performed for other reasons, due to insufficient available space in a component that cannot be further extended, a data check results. In all such cases the operation fails, and the referenced MDO component is unchanged.

An &ZMDORC value of 12 is returned under the following conditions:

An &ZMDORC value of 16 is returned if, on any verb, a map connection request fails. &ZMDOFDBK indicates the reason that the map connection failed.

Other system variables available to interrogate error conditions are:

&ZMDOID

Contains the identifier of the last known MDO involved in the last operation.

&ZMDOMAP

Contains the map name for &ZMDOID.

&ZMDONAME

Contains the fully qualified name of the MDO component involved in the last operation.

&ZMDOCOMP

Contains the name of the component. The value is the last name segment of the fully qualified name for the MDO component involved in the last operation, if applicable.

&ZMDOTYPE

Contains the type of &ZMDOCOMP, if applicable.

&ZMDOTAG

Contains the tag value of the component involved in the last operation, if applicable.