Microsoft KB Archive/31791

INVALID KEY Clause Executed after “Record or File Locked”

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

2.10 2.20 MS-DOS

Summary: Even though a file status 94, “Record or File Locked,” is returned when a requested record is in use, the INVALID KEY imperative statement is executed. Microsoft has confirmed this to be a problem in COBOL Versions 2.1 and 2.2. The INVALID KEY phrase applies to records that cannot be retrieved, whatever the cause. The INVALID KEY phrase is executed when the record is busy because, at that time, it is illegal for the program to access the record. Additionally, instructions in the DECLARATIVES SECTION will be executed when INVALID KEY or AT END phrases are not present on the READ command. However, the DECLARATIVES SECTION will not be executed when INVALID KEY or AT END phrases are present.

Additional reference words: 2.10 2.20 Copyright Microsoft Corporation 1993.