COMPRESSED 

COMPRESSED specifies a specific format for a data file.

If a load or unload command does not specify the format FORMATTED or FORMATTED BINARY explicitly, the system assumes that the data in the source file is in the COMPRESSED format (Replication Manager default). This means that it does not have to be specified explicitly in a load or unload command.

The COMPRESSED format can only be used for source files in plain text. Binary data files must be loaded with the FORMATTED BINARY attribute.

If you do not specify a format in a load or unload command, however the data is still not in plain text, the Replication Manager creates an error message.

customer.data

Position number

1   2       3    4       ....

 

001,mueller,69185,Walldorf
002,schmidt,13403,Berlin
003,kleinert,25000,Upper-Lower

The data fields do not have a standard format but are separated by commas:

FASTLOAD command:

FASTLOAD TABLE customer
  cno       1
  surname   2
  zip       3
  place     4
INFILE 'customer.data'

Data Lines

In COMPRESSED format, a data line must at least be long enough to represent the data. The length of the individual data fields and the total length of the data lines can vary. Each data line ends with a line break.

When data is loaded, a data line in a source file in this format corresponds to exactly one data record in the target table.

When data is unloaded, a data line in a source table in this format corresponds to exactly one data record in the target file.

Data Fields

Data fields in the data files must have the data type CHAR.

The individual data fields are separated by a freely selectable character (default value of the Replication Manager: comma). They can also be encapsulated in freely selectable characters (default value of the Replication Manager: double quotation marks).

If delimiters follow each other directly in a data line, then the value is the empty character string. If the relative position is larger than the number of values in the line, the value is also the empty character string.

Specified Position

The assignment of a data file data field to a column in the table is determined by the position <field_pos> in a command for loading or unloading data. This specifies a relative position within a data record. In other words, it specifies the value in a data record that is to be loaded into or unloaded from a specific column.

When you load data from a source table, the data fields in the target table in the database must be sorted in ascending order. You can also assign the same input values to different columns or even omit positions. If consecutive delimiters are detected or if the relative position is greater than the number of values in the line, the value is the empty character string.

When you unload data from the database into a target file, assign the position 1 to the first column in your list. The position numbers of the following columns rise by 1 each time. This also means that each position number can only be assigned once.