UN-EXCLUSIVE Statement [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation
HP COBOL II/XL Reference Manual
UN-EXCLUSIVE Statement
The UN-EXCLUSIVE statement is an HP extension to the ANSI COBOL standard.
The UN-EXCLUSIVE statement releases a file that has been previously
locked by the EXCLUSIVE statement.
Syntax
UN-EXCLUSIVE file-name-1
Parameter
file-name-1 is the name of a file that has been locked using the
EXCLUSIVE statement.
Description
It is not necessary to unlock a locked file before closing it. An
implicit UN-EXCLUSIVE statement is performed when you close the file.
However, if a user issues an unconditional EXCLUSIVE statement naming the
file that you have locked, that user's program suspends execution until
the file is available to be locked. Thus, you should use the
UN-EXCLUSIVE statement to unlock the file as soon as the program has
finished accessing it.
If the unlock is successful or the file is not locked, the STATUS-KEYs
are set to "00". If the file options do not specify dynamic locking or
the file number is invalid, STATUS-KEY-1 is set to "9" and STATUS-KEY-2
contains a binary error code.
A USE procedure may be specified for the file being unlocked. See "USE
Statement" later in this chapter and "Declarative Sections" in Chapter 8
for more details on USE procedures.[REV BEG] Also, for more
information on handling I/O errors, see "Input-Output Error Handling
Procedures" .[REV END]
MPE/iX 5.0 Documentation