Microsoft KB Archive/33228

READ NEXT Does Not Advance Record Pointer when Record Locked

PSS ID Number: Q33228 Article last modified on 07-28-1988

3.00 | 3.00 MS-DOS | OS/2

Summary: If one workstation running a COBOL Version 3.00 program has a record locked in a file shared on a network and another station executes a series of READ … NEXT commands, READs through the same data file, and attempts to READ the locked record, a file status of “9D” is returned to the second station. The next READ … NEXT command will reread the same record (i.e., the record pointer is not advanced). You must execute a START GREATER THAN to advance the pointer to the next record in the file. As the second station encounters the locked record, the contents of the locked record will be returned to the associated FD area. (Previous COBOL Versions returned null bytes to the COBOL FD area when the desired record was locked). To deal with locked records effectively, the program must be designed to detect when a record is locked. The application should not allow the user to rewrite the record read into the FD when the record is locked to another station. Microsoft is researching this problem and will post new information as it becomes available.

Copyright Microsoft Corporation 1988.