Displaying Null-Capable Fields

You can use the EVAL debug command to display the null indicator of a null-capable field. The null indicator is an internal variable (similar to the index variable for multiple-occurrence DS) which is named _QRNU_NULL_fieldname. The fieldname can be the name of an array if the array is null-capable.

When the debugger displays a null-capable field, the content of the field is displayed regardless of whether the field is considered null. For example, suppose FLD1 is null-capable, and is currently null. Then the result of EVAL _QRNU_NULL_FLD1 is '1' and EVAL FLD1 shows the current content of FLD1, even though its null indicator is on.

EVAL _QRNU_NULL_FLD1     Result:  _QRNU_NULL_FLD1 = '1'

EVAL FLD1                Result:  FLD1 = 'abcde'

If a data structure has null-capable subfields, the null indicators for all the null-capable subfields of the data structure are themselves stored as subfields of the data structure _QRNU_NULL_dsname.

If the data structure is not qualified, the null indicator data structure is not qualified. The names of the null capable subfields are in the form _QRNU_NULL_subfieldname.

For example, if qualified data structure DS1 has null-capable subfields FLD1 and FLD2 and non-null-capable subfield FLD3, then the data structure _QRNU_NULL_DS1 would have indicator subfields _QRNU_NULL_NULLFLD1 and NULL2. To display all the null-capable subfields of the data structure, use the debug command

EVAL _QRNU_NULL_DS1      Result:  _QRNU_NULL_FLD1 OF _QRNU_NULL_DS1 = '1'
                                  _QRNU_NULL_FLD1 OF _QRNU_NULL_DS1 = '0'

If the data structure is qualified, the null indicator data structure is qualified. The names of the null capable subfields are the same as the names of the data structure subfields.

For example, if qualified data structure DS2 has null-capable subfields F1 and F2 and non-null-capable subfield F3, then the data structure _QRNU_NULL_DS2 would have indicator subfields F1 and F2. To display all the null-capable subfields of the data structure, use this debug command:

EVAL _QRNU_NULL_DS2      Result:  _QRNU_NULL_DS2.F1 = '0'
                                  _QRNU_NULL_DS2.F2 = '1'

To display the null indicator of a variable, use the same EVAL expression in the debugger as you would use to access the variable itself, replacing the outermost name with _QRNU_NULL_name.

EVAL FLD1                          Result: 'abc'
EVAL _QRNU_NULL_FLD1               Result: '0'

EVAL SUBF2                         Result: 0
EVAL _QRNU_NULL_SUBF2              Result: '1'

EVAL ARR(3)                        Result: 13
EVAL _QRNU_NULL_ARR(3)             Result: '1'

EVAL DS3.INFO(2).SUB4              Result: 'xyz'
EVAL _QRNU_NULL_DS3.INFO(2).SUB4   Result: '0'


[ Top of Page | Previous Page | Next Page | Contents | Index ]