Additional numeric EXTERNAL or CHARACTER field considerations


This topic describes additional considerations that apply to numeric EXTERNAL fields and CHARACTER fields.

A numeric EXTERNAL or CHARACTER field for a numeric column produces an EBCDIC character representation of the numeric value. The major difference between the two is that numeric EXTERNAL is a numeric type, and CHARACTER is a character type. This difference is important when using IF condition VALUE(), because the data type of the value must match the data type of the field. For example, INTEGER EXTERNAL(9) requires that you use a numeric value like VALUE(0), while CHARACTER(9) would require you to use a character value such as VALUE('        0') to get the same results.

Related topic

The following table illustrates what you can expect when you use numeric EXTERNAL:


Results from numeric EXTERNAL

Data type

Result

SMALLINT EXTERNAL

INTEGER EXTERNAL

BIGINT EXTERNAL

  • Character representation of the integer value with leading zeros removed, unless you also specify FILL=YES or specify the FILL installation option
  • Leading '-' sign if negative
  • No decimal point, and right-justified in an 11-byte maximum field (for SMALLINT and INTEGER) or 20-byte maximum field (for BIGINT)

UNLOAD PLUS uses blanks to pad the value if the field is longer than 11 (SMALLINT and INTEGER) or 20 (BIGINT).

DECIMAL EXTERNAL

  • Character representation of the decimal value with leading zeros removed, unless you also specify FILL=YES or specify the FILL installation option
  • Leading '-' sign if negative
  • Decimal point as indicated by the scale and right-justified in a 33-byte maximum field

UNLOAD PLUS uses blanks to pad the value if the field is longer than 33.

FLOAT EXTERNAL

Character representation of the floating-point value in the format of +-.dddddddddE+-ee

The maximum field width is 15 for single precision and 24 for double precision.

DECFLOAT EXTERNAL

Character representation of the decimal floating-point value

The maximum field width is 23 for a precision of 16 and 42 for a precision of 34.

 

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