All LONG Values to Be Unloaded Are in One File
When you unload LONG values, you must differentiate between the following cases:
Case 2: All LONG values in a column to be unloaded are written to one file
In the command for unloading data you enter the name of a data file for each LONG column, into which the LONG values of this LONG column are entered.
If the LONG column you want to unload has no value in a data record (the value is an empty character string), the position for this LONG value is generated as follows: The start position is the end position of the preceding LONG value in the column plus 1; the end position is the end position of the preceding LONG value in the column. This means that the start position is always 1 larger than the end position.
The start and end position of the generated LONG value in the data file enable the LONG values to be assigned to the data records of the target file.
DATAEXTRACT * FROM hotel
cno 1
name 2
info 3
OUTFILE 'hotel.data'
LONGFILE info 'info.data'
Contents of the target file:
10,Excelsior,1-880
30,Flora,881-1046
60,Bellevue,1047-1360