null_assign 

Syntax

<null_assign> ::= [IF] NULL SET '<valLITERAL>'

'<valLITERAL>'

Null value representation

Place the value for the null representation in single quotation marks. This is a plain text value that the Replication Manager represents as a character string or binary numeric value. This depends on the external data type of the column for which you want to generate the null value.

If you want to display the null value representation in one of the binary external data formats, it must have a valid numeral format. This means either a floating decimal number in mantissa/exponent representation, with the agreed or standard decimal setting.

The generated null value representation is written to the same place in the file as the actual column value.

If the null value representation is shorter than the length of the value specified by the position, the value is filled with space characters. If the null value representation is longer, it is shortened to the specified length. The Replication Manager generates a warning.

If columns in the target table permit NULL values and you have not specified a null value representation, the Replication Manager default for unloaded NULL values is used (null_spec). This has the external data type CHAR.
If you define a null value representation for unloading NOT-NULL columns, it does not cause an error.

Use

This is a syntax rule for describing columns.

Use it in a command for unloading data to specify which value for the data field of the source table is written to the target file if the value in the source table is a NULL value.

You want to unload the source table article from the database into the target file article.data. Some of the columns in the table contain NULL values.
Define a separate condition for each of these columns. If this condition is met, the corresponding null value representation is entered in the target file.

DATAEXTRACT * FROM article
OUTFIELDS
  foa       01-08
  des       09-39          IF NULL SET '   '
  stock     40-43 INTEGER  IF NULL SET '0'
  min_ord   44-45 INTEGER
  price     46-53 DECIMAL (2) IF NULL SET 'X'
  weight    54-57 REAL
OUTFILE 'article.data' FORMATTED

You want to unload the source table article from the database into the target file article.data. Some of the columns in the table contain NULL values.
Because there is no null value representation defined for the column in the command, but all values have the external data type CHAR, the Replication Manager default null value representation
'?' is used.

DATAEXTRACT * FROM article
OUTFIELDS
foa 01-08
des 09-39
stock 40-51
min_ord 52-63
price 64-74
weight 75-85
OUTFILE 'article.data' FORMATTED

You want to unload the source table article from the database into the target file article.data. Some of the columns in the table contain NULL values.
Because there is no null value representation defined for the column in the command, the Replication Manager attempts to use the null value representation defined as a default (data type CHAR). This causes an error if a numeric external data type has been defined for the columns. The command terminates with an error message.

DATAEXTRACT * FROM article
OUTFIELDS
  foa       01-08
  des       09-39
  stock     40-43 INTEGER
  min_ord   44-45 INTEGER
  price     46-53 DECIMAL (2)
  weight    54-57 REAL
OUTFILE 'article.data' FORMATTED