Unlocks a KSAM file dynamically locked by BKLOCK.
CALL BKUNLOCK(filenum,status)
|
A file locked by BKLOCK is released for use by other users with a call to BKUNLOCK. (If you log off from any connection with the system, the file is also unlocked.) Since dynamic locking takes place during shared access to the same file by more than one user, it is important that any file locked by BKLOCK be unlocked as soon as possible by BKUNLOCK.
To use BKUNLOCK, the file must be opened with dynamic locking allowed by all users who share access to the file.
Parameters |
 |
- filenum
A numeric variable containing the file number that identifies the file. This number was returned to filenum by the last call to BKOPEN. It should not be altered until the file is successfully closed by BKCLOSE. (Required parameter)
- status
A four-character string variable to which is returned a code that indicates whether or not the call to BKLOCK was successful and if not, why not. The first character is set to zero when the call succeeds, to another value if it fails. (Required parameter)
Operation Notes |
 |
After calling BKUNLOCK, you should always check the status parameter to make sure that the procedure was successfully executed. When successful, a file locked by BKLOCK is again made available for access by other users. If the file is not locked by BKLOCK when BKUNLOCK is called, the file is not affected.
Figure B-12 “Dynamically Unlocking a KSAM File” illustrates the use of BKUNLOCK to unlock the file after it is updated.