(Contents)(Previous)(Next)

Output of NULL Values

A character string that can be defined using the SET command is used to represent NULL values in the target file.

For each output column, a particular constant can be declared that will be written into the output record when a NULL value occurs:

Example 1:

DATAEXTRACT hno, arrival, departure FROM reservation;

hno 01-05

arrival 07-13

departure 15-21 IF NULL SET POS 15-29 = 'permanent_guest'

OUTFILE ...

The keywords IF and SET can be omitted, whereas the keywords NULL and POS are mandatory. The default operator is '='. Further operators are not allowed.

The position specification of the output field for the constant is made in the same way as all other position specifications. LOAD does not check whether this output field overlays other fields.

It is only necessary to specify the data format of the constant in the output file when it is not the default CHAR. In any case, the constant must be specified within the statement as plaintext value enclosed in single quotation marks.

If the constant is to be output in one of the numerical data formats INTEGER, DECIMAL, or ZONED, it must have a valid number format. This means that it must either be a floating point number in mantissa/exponent representation, or a fixed point number in the currently determined or default decimal representation.

Example 2:

DATAEXTRACT itno,name,price,expiration_date FROM item;

itno 01-03

name 07-26

price 30-42 ZONED NULL POS 30-42 ZONED '-1,00'

expiration_date 46-51

OUTFILE item.extract

DATE 'yymmdd'

DEC '/ /./'

Specifying a NULL condition for NOT NULL columns does not produce a syntax error as it does for DATALOAD and DATAUPDATE, because no subsequent errors can result from it.


(Contents)(Previous)(Next)