Skip to content

LOG CLOSE

Close Transaction Log File

This directive closes the transaction log file.

LOG CLOSE [,ERR=line-ref|,ERC=error-code]
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.

No further entries are made for this Thoroughbred Basic task after the log-is-closed marker is added to the end of the log file.

If there is an outstanding TRANSACTION BEGIN that has not been committed by the COMMIT directive or rolled back by the ROLLBACK directive then the LOG CLOSE fails.

LOG CLOSE is an optional Transaction Processing directive. A LOG CLOSE may be used to change log files.

Directives that close all channels, such as BEGIN, END, CLOSE(0) and RELEASE, automatically execute a ROLLBACK if a TRANSACTION BEGIN is active, followed by a LOG CLOSE.

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

COMMIT, LOG OPEN, ROLLBACK, and TRANSACTION BEGIN directive

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