gnucobol-users
[Top][All Lists]
Advanced

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

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


From: Roger While
Subject: [open-cobol-list] Re: Should These Examples Compile?
Date: Tue Feb 21 22:41:03 2006

For the first example, as Sergey pointed out, compile with
one of -std=mf,ibm,mvs,bs2000.
In CVS and the 0.33 prerelease at usual download address, the
relax-level-hierarchy is per default activated for these
standards.

For the second example, I agree with Sergey -
* Micro Focus Server Express         V2.2 revision 000           Compiler
* Copyright (C) 1984-2003 Micro Focus International Ltd.
* Accepted - verbose
* Accepted - nolist
* Compiling test2.cob
     8      05 D PIC X.
* 225-S*******                                                               **
**    Level hierarchy wrong

Roger

Regarding the first sample, we already have a fix for that.
It's in version 0.33 (and probably CVS)
The only thing you should do is to put
relax-level-hierarchy: yes
in your ibm.conf or mvs.conf, etc and use this as a dialect, i.e.
cob -x -std=ibm test.cbl

Regarding second example, it's incorrect and Microfocus also pointing that out:
G:\skatests\cobol>cobol ztest9.cbl;
MERANT Micro Focus Net Express V3
Version 3.1.11 Copyright (C) 1984-2000 MERANT International Ltd.
URN AXCGG/AA0/00000
     9      05 D PIC X.
* 225-S******* **
**    Level hierarchy wrong
* Checking complete - errors found

It also does not compile on Mainframe:
SKASHYR 7> cob2 test9.cbl
 PP 5655-G53 IBM Enterprise COBOL for z/OS  3.3.1 in progress ...
 LineID  Message code  Message text
      8  IGYDS1052-E   Group item "C" contained the "PICTURE" clause.  The
                       clause was discarded.
13 IGYPS0009-E "STOP" should not begin in area "A". It was processed as
                       if found in area "B".
Messages Total Informational Warning Error Severe Terminating
 Printed:       2                                    2
 End of compilation 1,  program PROG,  highest severity 8.
 Return code 8

Regards,
Sergey


----- Original Message -----
From: "Robert Sherry" <address@hidden>
To: <address@hidden>
Sent: Tuesday, February 21, 2006 4:18 PM
Subject: [open-cobol-list] Should These Examples Compile?


>    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]