NULLCHAR


This option allows you to change the null indicator character in the output record.

This option specifies the value, length, and position of the null indicator character in the output record.


image-2023-11-17_10-54-18.png

The following table describes the values that you can specify for this option:

Values for the NULLCHAR option

Value

Type

Description

?

String

(Default) Tells BMC AMI Unload to fill the null indicator field with the question mark character, '?'

'c'

String

Tells BMC AMI Unload to fill the null indicator field with the character c, where is any constant that is valid for C-type assembler language

‘string’   

String

Tells BMC AMI Unload to specify the null indicator value and length. The length can be from 1 through 4 characters.

HIVAL


Tells BMC AMI Unload to fill the null indicator field with high values

X'xx'


Tells BMC AMI Unload to fill the null indicator field with xx, where xx is any valid hexadecimal assembler constant, except X'00'

TRAILING

Position

(Default) Places the null indicator at the end of the field

LEADING

Position

Places the null indicator at the start of the field

UPFRONT

Position

Places null indicators for all nullable column in an array at the beginning of the record

For example, if four nullable columns are in the record and the null marker is ?, the first and third are nulls, but the second and fourth are not. Therefore, there are four characters at the beginning of the record corresponding to the four nullable columns. These characters have the values in hexadecimal X'6F006F00', where X'6F' is ?. BMC AMI Unload uses this hexadecimal when converting from the CA Fast Unload product for Db2. The generated load statement has a NULLIF clause with correct position values in the null markers array.

If you specify both the NULLTYPE and NULLCHAR options:

  • The highest string value determines the null indicator length.
  • The location value of the second option determines the null indicator position.

If the null indicator string value is 1-byte long, specifying NULLTYPE T2 or L2 duplicates it.

Example

The following example results in a trailing, 2-byte null indicator ('??'):

NULLCHAR('?',LEADING) NULLTYPE T2

The resulting string value is '??' because NULLTYPE T2 duplicates the 1-byte NULLCHAR string value ('?').

The resulting position is trailing because NULLTYPE T2, which specifies a trailing null indicator, is the second option.

Example

The following example results in a leading, 2-byte null indicator:

NULLCHAR('?$',TRAILING) NULLTYPE L1

The resulting string value is 2-bytes long because the 2-byte string value in the NULLCHAR option ('?$') is higher than the 1-byte determined by NULLTYPE L1.

The resulting position is leading because NULLTYPE T1, which specifies a trailing null indicator, is the second option.

Example

The following example results in a trailing null indicator of X'FFFF':

NULLTYPE L2 NULLCHAR(X'FF')

The resulting string value is 2-bytes (X'FFFF') because NULLTYPE L2 duplicates the 1-byte NULLCHAR string value (X'FF').

If you specify FORMAT DSNTIAUL, BMC AMI Unload overrides the NULLCHAR value to '?'.

When you download a nullable field from the table, BMC AMI Unload places a marker in the unloaded data trailing the field, leading it, or in front of the unloaded record. The marker may have from one to four characters.

The NULLCHAR specification must be coded immediately after FORMAT DSNTIAUL or FORMAT EXTERNAL.

The field content when its value is null is binary zeros. Conversely, when the nullable field is not null, the null marker is set to binary zeros.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*