ABSENT.NULL |
![]() ![]() ![]() |
The ABSENT.NULL keyword treats an absent record as a null item rather than an error.
Format
ABSENT.NULL
There are situations where two or more related files share a common record id (or a related id) but some ids may not appear in all of the files. The ABSENT.NULL keyword, normally used with a select list, allows reports to be constructed that draw data from the complete set of files, returning a null record for any item that is not present in the main file processed by the query. A dictionary I-type entry can then be used to retrieve data from the related files.
Example
FILE1 contains records 1 and 2. FILE2 contains records 2 and 3.
The dictionary for FILE1 contains an I-type entry, F2REF, that is a simple TRANS() using the record id of FILE1 to access the same record in FILE2, returning data from this file. TRANS(FILE2, @ID, FIELD.NAME, 'X')
If we have a select list containing 1, 2 and 3, LIST FILE1 F1 F2REF would report records 1 and 2 but give an error for record 3.
Adding the ABSENT.NULL option, LIST FILE1 F1 F2REF ABSENT.NULL will process records 1, 2, and 3 from both files, using a null record for the absent records (3 in FILE1 and 1 in FILE2). |