FORMATTED (FWV, Fixed Width, Columnar Values) is a possible format of a data stream. As this format is not the default value of the Loader, it must be explicitly specified in an unload or load command.
The FORMATTED format can only be used for source data streams in plain text. Data streams with binary values must be loaded with the FORMATTED BINARY format.
customer.data
Position no. |
1 2 3 4 5 6 7 8 9 ..... |
|
0 1 m i l l e r – 1
0 2 7 7 N e w
Y o r k - - - |
The data fields have a uniform format.
FASTLOAD command:
FASTLOAD TABLE
customer
cno 01-02
surname 03-10
zip 11-15
place 16-27
INFILE 'customer.data' FORMATTED
A data line in a data stream corresponds to a data record that you want to unload or load.
All data lines have the same fixed length. Each line in the data stream contains the individual data fields at the same position with a fixed length. Each data line ends with a line break.
The assignment between data fields in the data stream and the table columns is made using the position specification in a command for unloading or loading data.
The data fields in the data stream are described using their byte start and end position. The first possible byte start position is 1. Specifying an end position is optional. If no end position is specified for a data field, it has a length of 1.
The assignment between the data fields in the data stream and table columns can be made in any order. The order does not affect the processing speed.
The positions do not need to follow each other directly when you unload or load data. When it unloads data, the Loader fills any gaps with blank characters.