gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] Should These Examples Compile?


From: Robert Sherry
Subject: [open-cobol-list] Should These Examples Compile?
Date: Tue Feb 21 13:19:02 2006

    Please consider the following COBOL program:
 
        IDENTIFICATION   DIVISION.
        PROGRAM-ID.      prog.
        DATA             DIVISION.
        WORKING-STORAGE  SECTION.
        01  A.
             05 B.
                 10 C PIC X.
            04 D.
             05 E PIC X.
          PROCEDURE        DIVISION.
            STOP RUN.
 
Please consider the record A which contains the data items B and D. I 
claim that B and D should be treated as being at the "same level". 
Therefore, I believe this code should compile. It does compile with 
the Micro Focus COBOL compiler as well as the IBM Mainframe compiler. 
However, it does not compile with the latest version of the Open Source
COBOL Compiler. This program does not compile with the latest version of the
Open Source COBOL Compiler.  However, it does compile with the Micro Focus
COBOL compiler as well as the IBM Mainframe compiler.

In addition, the following program also does not compile with the Open
Source compiler, but does with the IBM and Micro Focus compiler.
       IDENTIFICATION   DIVISION.
       PROGRAM-ID.      prog.
       DATA             DIVISION.
       WORKING-STORAGE  SECTION.
       01  A.
            05 B PIC X.
            03 C PIC X.
            05 D PIC X.
       PROCEDURE        DIVISION.
          STOP RUN.

We have a fix for this in cobc/field.c and I would be happy to post the fix
either to the group or add the fix to official CVS tree. 

Bob Sherry




reply via email to

[Prev in Thread] Current Thread [Next in Thread]