


The external data format of the corresponding field value in the source file can be specified for each input field.
Example:
DATALOAD TABLE item
itno 01-08 CHAR
descr 09-39 CHAR
stock 40-43 INTEGER
min_stock 44-45 INTEGER
ordered 46-49 INTEGER
delivdate 50-57 CHAR
price 58-65 DECIMAL(2)
weight 66-69 REAL
INFILE ...
The structure of the external data formats is described in chapter External Data Formats.
The data format specification is only needed when the field values are not stored in plaintext (CHAR).
LOAD can edit input data in any numerical data format (INTEGER, DECIMAL, ZONED, and REAL) generated by an application program for any numerical column type of the table (FIXED, FLOAT, SMALLINT, or INTEGER).
Plaintext values can be used as input for any column type. If the values are to be entered into CHAR or DBYTE columns, the input length must not exceed the column length. Shorter input values are allowed.
If the target column requires a numerical value, it must be possible to interpret the plaintext input value as a number. Fractional digits are implicitly truncated when the precision of the column is less than that of the input value. Integral digits, on the other hand, must completely fit into the target column.
To be able to edit the input file in every environment, each of the mentioned data formats can also be supplied in hexadecimal representation, where two hexadecimal digits represent one byte. The additional specification HEX must be added to the data type in this case, namely

A valid hex constant only consists of the characters '1' to '9' and 'A' to 'F' or 'a' to 'f'. In case of HEX data types, the length of an input field must be even.
Example:
DATALOAD TABLE item
itno 01-08 CHAR
descr 09-19 CHAR
stock 20-27 INTEGER HEX
min_stock 29-32 INTEGER HEX
ordered 34-41 INTEGER HEX
delivdate 43-50 CHAR
price 52-59 DECIMAL(2) HEX
weight 61-68 REAL HEX NULL IF POS 61-62 = '00'
INFILE *
01785523hammer 00002710 03E8 00001388 19971130 0001195C 00
...
The hexadecimal representation does not solve the problem of differing representations of binary data formats, such as INTEGER and REAL, on different computers. This example requires a 2-byte integer to have the format high-byte, low-byte. The data record then contains the values 10,000 (for STOCK), 1,000 (for MIN_STOCK), 5,000 (for ORDERED), and 11.95 (for PRICE).


