COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-117
LOCKFILE
•
Declarative Procedures
If a declarative procedure applies to the file and the time interval expires, the
declarative procedure is performed, and program execution continues with the
statement following the one terminated (see Expired Time Limit). If error message
42 or 90 is returned after the declarative procedure executes, the run unit
terminates abnormally.
•
Interaction of LOCKFILE and READ LOCK Statements
If your process executes a READ LOCK statement on a file that it or any other
process has locked with a LOCKFILE statement, or your process executes a
LOCKFILE statement against a file that has an outstanding READ LOCK, the TIME
LIMIT phrase determines what happens.
If the second statement attempting to lock the file has a TIME LIMIT phrase, it
keeps trying to lock the file until the time limit expires. Either it fails and then times
out or it succeeds in locking the file.
If the second statement attempting to lock the file has no TIME LIMIT phrase, it
suspends execution until the statement succeeds because the contending lock is
removed or until the program is terminated by an external agency (such as the
TACL command STOP).