Microsoft KB Archive/42950

Last Directive in COBOL.DIR Not Read If No Carriage Return

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

3.00 3.00a | 3.00 3.00a MS-DOS | OS/2

Summary: The Microsoft COBOL Compiler Versions 3.0 and 3.0a will not recognize the last directive in the COBOL.DIR file unless there is a carriage return after the last directive. In editors such as Microsoft Word or the Microsoft Editor (M.EXE or MEP.EXE), be sure that the cursor is on the next line after the final directive before saving the file. To ensure the compiler is using the directives that you set, use the CONFIRM and SETTING directives. CONFIRM causes the compiler to echo the specified directives to the screen during compilation. The SETTING directive causes most of the directives to be included in the compilation listing. The COBOL.DIR file is an ASCII file that contains compiler directives. The compiler reads this file at compile time. The COBOL.DIR file that is created by the SETUP.EXE program does contain a carriage return on the last line. A carriage return is also required at the end of the last line of the source file or COPY file. The COBOL compiler ignores the last line if it has no carriage return, which can cause compile-time or run-time errors.

Additional reference words: 3.00 3.00a Copyright Microsoft Corporation 1993.