Makes READ statements detect when a record is locked by another program if the file is opened for INPUT.


   +-/-+ +-NO-+




Phase: Syntax check
$SET: Initial


The Compiler also accepts the name without a hyphen; that is, DETECTLOCK.

With DETECT-LOCK, if a READ statement reads a record locked by another program, it returns an I/O status of 9/068. With NODETECT-LOCK, it returns 0/000. In both cases it reads the record successfully.

If a READ statement attempts to lock a record (that is, if the statement LOCK MODE IS AUTOMATIC has been specified, or a WITH LOCK phrase is used on the READ statement), and the record is locked by another program, an I/O status of 9/068 is returned. If NODETECT-LOCK is specified, and the READ statement is not attempting to lock a record an I/O status of 0/000 is returned.

When DETECT-LOCK is specified, individual READ statements can be made to ignore locks by using the READ ... IGNORE LOCK syntax.