Microsoft KB Archive/33227

Detecting File- and Record-Level Locks in COBOL Version 3.0

PSS ID Number: Q33227 Article last modified on 04-21-1993

3.00 | 3.00 MS-DOS | OS/2

Summary: The following article describes how to detect file-level locks and record-level locks: 1. File-level locks can be detected after an OPEN statement by examining the values returned in the file status bytes. File status is contained in two bytes. A value of “9A” indicates that the file is locked. This can also be represented as an ASCII 9 in the first byte and a decimal 65 in the second byte. 2. Record-level locks can be detected after a READ statement by examining the values returned in the file status bytes. A value of “9D” in the file status indicates the record you have just attempted to read is locked. This can also be represented as ASCII 9 in the first byte and decimal 68 in the second byte.

Additional reference words: 3.00 Copyright Microsoft Corporation 1993.