Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (L)
Guardian Procedure Calls Reference Manual—522629-013
8-20
LOCKREC Procedure
LOCKREC Procedure
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameters
Condition Code Settings
Considerations
OSS Considerations
Related Programming Manual
Summary
The LOCKREC procedure excludes other users from accessing a record at the current
position. The “user” is defined either as the opener of the file (identified by
filenum) if
the file is not audited—or the transaction (identified by the TRANSID) if the file is
audited.
For key-sequenced, relative, and entry-sequenced files, the current position is the
record with a key value that matches exactly the current key value. For unstructured
files, the current position is the relative byte address (RBA) identified by the current-
record pointer.
If the record is unlocked when LOCKREC is called, the record becomes locked, and
the caller continues executing.
If the file is already locked by another user, behavior of the system is specified by the
locking mode. There are two “locking” modes available:
•
Default—Process requesting lock is suspended (see “Considerations”).
•
Alternate—Lock request is rejected with file-system error 73. When the alternate
locking mode is in effect, the process requesting the lock is not suspended (see
“Considerations”).
Note. LOCKREC operations cannot be used with queue files.
Note. A call to LOCKFILE is not equivalent to locking all records in a file; that is, locking all
records still allows insertion of new records, but file locking does not. File locks and record
locks are queued in the order they are issued.