Microsoft KB Archive/44235

COBOL 3.0a; DISPLAY Incorrect If LINE/COLUMN Before Data Item

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

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

Summary: The Microsoft COBOL version 3.0a DISPLAY statement produces incorrect results if the LINE and COLUMN clauses appear prior to the data item being displayed. If this undocumented format is used, the compiler ignores the LINE and COLUMN clauses and also fails to insert a carriage return between DISPLAYed lines. The result is that the data items are displayed starting at LINE 1 COLUMN 1 and strung together, wrapping around on the screen. Microsoft has confirmed this to be a problem in version 3.0a. This problem has been corrected in Microsoft COBOL Professional Development System version 4.0. This problem does not occur in version 3.0 of the Microsoft COBOL Compiler.

More Information: Both of the following syntax descriptions demonstrate the problem: DISPLAY LINE  COLUMN  . DISPLAY AT  .

Code Example
****************************************************** *                  PROG1.COB                         * * This program shows the incorrect syntax and results. PROCEDURE DIVISION. display at 0115 &quot;This program does not work&quot;. display at 0315 &quot;This program does not work&quot;. display at 1015 &quot;This program does not work&quot;. display line 13 col 15 &quot;This program does not work&quot;. display line 15 col 15 &quot;This program does not work&quot;. display line 17 col 15 &quot;This program does not work&quot;. display line 20 col 15 &quot;This program does not work&quot;. STOP RUN. ****************************************************** *                  PROG2.COB                         * * This program also shows the correct syntax and results. PROCEDURE DIVISION. display &quot;This program works&quot; line 01 col 15. display &quot;This program works&quot; line 03 col 15. display &quot;This program works&quot; line 10 col 15. display &quot;This program works&quot; at 1315. display &quot;This program works&quot; at 1515. display &quot;This program works&quot; at 1715. display &quot;This program works&quot; at 2015. STOP RUN. Additional reference words: 3.00a Copyright Microsoft Corporation 1993.