
At the beginning of a LOAD session, a file is created or updated into which the following is logged:
* database and user names
* points in time of starting and ending the file
* executed command file
* all executed SQL statements
* all executed load statements
* all input records rejected for each load statement, with information about the cause of the error
* the accumulated counter readings for each load statement (inserted/updated and rejected rows)
* all executed extract statements, (with a description of the output file format, if this is not stored in the target file)
* a message, if the run was aborted.
The name of the session log file (PROT) can be set with the SET command. For the default setting, refer to the platform-specific User Manual. The log file is used with APPEND; i.e., it is not deleted with each LOAD call.
The log file is structured in such a way that parts of it can easily be used to generate a command file. In a new record, all comments begin with '/ *' or '/ <letter>'. Thus they will be ignored by a RUN <file> command. All message or error text lines in the log file are indicated by a letter at the beginning of the line.
'/ M' informative system messages, such as the number of inserted and rejected rows, last committed transaction etc.
'/ E' lines with error messages. It indicates, e.g., the two lines which, in case of rejected rows, contain a table and position specification, the error number, or an error text.
'/ R' rows with error messages resulting from an IF $RC (SQL statement) check. These error messages do not occur in the summary at the end of the log file.
'/ X' rejected rows with binary data. These rows are recorded in hexadecimal representation in blocks of 20 bytes each (i.e., of 40 hexadecimal digits).
'/ C' comment lines of the executed command file which where inserted into the log file. These are all lines beginning with '/' or '*' that are longer than three characters.
'/ S' the summary of all errors that occurred at the end of the load run.
At the point in time of error detection, data records rejected in block statements (e.g., DATALOAD, FASTLOAD) are no longer available in the memory of LOAD. To be able to record more than the line number, LOAD converts the data from the available internal format into a compressed plaintext representation. In this case, the error position indicates the number of the column the input value of which is invalid. To reload such data records from the log file, the load statement must exclude the comment lines by a table condition IF POS 1 <> '/', and it must contain the file options NULL 'NULL' and SEPARATOR '|'.
Example of the log file contents:
/ M TESTUSER on XDBDIST1
/ *
/ M START 28.02.1997 17.44.19
/ *
run item.load
/ *
IF $RC (DELETE FROM ITEM) = -4004
/ *
/ R -4004 UNKNOWN TABLE NAME:ITEM
/ *
CREATE TABLE item
( itno char (8) key,
descr char (20),
stock fixed (10),
min_stock fixed (5),
ordered fixed (10),
delivdate date,
price fixed (6,2),
weight float (5) )
/ *
DATALOAD TABLE item
itno 01-08 CHAR
descr 09-28 CHAR DEFAULT NULL
stock 29-36 INTEGER HEX DEFAULT NULL
min_stock 37-40 INTEGER HEX DEFAULT NULL
ordered 41-48 INTEGER HEX DEFAULT NULL
delivdate 49-58 CHAR DEFAULT NULL
price 59-67 CHAR DEFAULT NULL
weight 68-78 CHAR DEFAULT NULL
INFILE load.in
DATE 'EUR'
DEC '/ /./'
NULL '?'
/ *
"01785523"|"hammer"|10 000|1 000|5 000|30.11.1997|11.95|5.0000E-01
/ E Table "item "
/ E 200 DUPLICATE KEY
"01785524"|"chisel"|8 100| 1 000|5 000|30.11.1997|19.90|1.5000E+00
/ E Table "item "
/ E 200 DUPLICATE KEY
"01785225"|"screw driver"|795|300|500|07.08.1997|2.95|2.0000E-02
/ E Table "item "
/ E 200 DUPLICATE KEY
"01785526"|"drilling machine"|600|10|NULL|NULL|198.95|3.2700E+00
/ E Table "item "
/ E 200 DUPLICATE KEY
"01785527"|"screw"|10 000|5 000|3 000|05.02.1998|0.99|5.0000E-03
/ E Table "item "
/ E 200 DUPLICATE KEY
"01785828"|"dowel"|NULL|NULL|NULL|05.02.1998|0.99|NULL
/ E Table "item "
/ E 200 DUPLICATE KEY
/ M Last transaction committed at input line 16
/ *
/ M ITEM : inserted 10, rejected 6 lines
/ *
DATAUPDATE TABLE item
itno 01-08
descr 10-24
SET stock 25-31
SET ordered 32-38
SET delivdate 40-49
SET price 51-56
INFILE *
DEC '/./,/'
/ *
01785523 hammer 10.000 5.000 15.01.1998 13,95
/ E Table "item " INFILE column 40
/ E -17411 Input string is too long
01785525 screw driver 795 500 15.01.1998 2,95
/ E Table "item " INFILE column 40
/ E -17411 Input string is too long
/ M ITEM : 0 lines updated, 2 lines invalid
/ *
/ M Last transaction committed at input line 2
/ *
/ M ITEM : updated 0, rejected 2 lines
/ *
DATAEXTRACT * FROM item ; OUTFILE item.new
/ *
/ M RECORD-Size : 112
/ M OUTFILE-Format :
ITNO 1-8 CHAR
DESCR 12-31 CHAR
STOCK 35-48 CHAR
MIN_STOCK 52-58 CHAR
ORDERED 62-75 CHAR
DELIVDATE 79-86 CHAR
PRICE 90-98 CHAR
WEIGHT 102-112 CHAR
/ *
/ M Rows written : 257
/ *
/ S 6 x DBKERN 200 DUPLICATE KEY
/ S 2 x LOAD 17411 Input string is too long
/ *
/ M STOP 28.02.1997 17.46.02
