Microsoft KB Archive/36895

COBOL 3.0 RETRYLOCK Directive Doesn’t Work with File STATUS

PSS ID Number: Q36895 Article last modified on 04-20-1993

3.00 | 3.00 MS-DOS | OS/2

Summary: Successful use of the RETRYLOCK directive requires the following: 1. The file containing the record that is locked must NOT have a File STATUS clause. 2. The program must be compiled with the RM directive (RM is for Ryan-McFarland COBOL Version 2.0 compatibility). Also, the (+r) run-time switch can be used instead of RETRYLOCK if the file that contains the record that is locked does NOT have a file STATUS clause. This information needs to be added to the “Microsoft COBOL Compiler Version 3.0: Operating Guide”.

More Information: The RETRYLOCK directive generates code to continuously reread a locked record. This is the equivalent to the WAIT statement in COBOL Versions 2.1 and 2.2. The following scenario explains the action of RETRYLOCK or the (+r) run-time switch: If program A reads record 1 and locks it, program B then attempts to read record 1 from the same file. RETRYLOCK or the (+r) run-time switch causes program B to continuously reread record 1. Please note that it will appear that program B has hung. Program B will resume execution when program A releases record 1. Note: the parentheses are required with the (+r) run-time switch. If your program was called LOCKISAM.EXE, it would be invoked by typing the following: LOCKISAM (+r)

Additional reference words: 3.00 Copyright Microsoft Corporation 1993.