Skip to content

LOG OPEN

Open File for Log File Entries

This directive initializes the transaction log file system. Consistency checks are made to the various files that are used by the logging system. Entries are made into the log file representing the before and after I/O images of records that have been altered or deleted.

LOG OPEN filename, option [,ERR=line-ref|,ERC=error-code]
filename
is any string variable representing the file to be used in the logging of all of this tasks I/O update activity. The file must be either empty, or a previously used log file.
option
is any string representing the mode of logging entries into the transaction log file. All transactions use the REWIND mode.

REWIND The only entries made into the log are the updates made after a

TRANSACTION BEGIN and before a COMMIT or ROLLBACK directive. After a COMMIT or ROLLBACK, the log file pointer is rewound to where the transaction started.

line-ref
is the program line number or label to branch to if this directive produces an error.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.

You cannot have more than 1 log file open at a time.

LOG OPEN is an optional Transaction Processing directive. If a TRANSACTION BEGIN is executed with no LOG OPEN, then a default LOG OPEN is performed using the values in PRM TPLOGPATH and PRM TPLOGNAME. The default value for TPLOGPATH is /usr/lib/basic/TPLOGS (or your Windows home path) and the default value for TPLOGNAME is “TPLOG.”+ TaskId.

If this directive is used, it must occur prior to TRANSACTION BEGIN.

Starting with release level 8.6.0, REWIND is the only supported Transaction Processing mode.

00010 LOG CLOSE
00020 LOG OPEN “LOG”+FID(0), “REWIND”
00030 OPEN(2) "DIRECTFILE"
00040 TRANSACTION BEGIN

COMMIT, LOG CLOSE, ROLLBACK, and TRANSACTION BEGIN directives

From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF