Microsoft KB Archive/21297

EXIT Statement in UnSectioned Programs

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

2.10 MS-DOS

Summary: If a paragraph with no section specification immediately follows a paragraph containing an EXIT statement, the EXIT statement fails to return to its initiation point. Instead, execution falls through the logic of the program until it encounters a section label. When this occurs, execution returns to the previously assumed initiation point or program end. Page 248 of the “Microsoft COBOL Compiler Reference” states the following: If only a section name is specified, control returns after the last statement of the last paragraph of the section. This is considered to be the correct behavior for COBOL versions 3.0 and later. You can work around this problem by writing the entire program using section and paragraph labels.

Additional reference words: 2.10 Copyright Microsoft Corporation 1993.