On Mon, Sep 28, 2015 at 3:19 PM, Binyamin Dissen <[email protected]
> wrote:

> On Mon, 28 Sep 2015 14:11:14 -0500 John McKown <
> [email protected]>
> wrote:
>
> :>OK, just for "fun", I have downloaded a lot of the company's COBOL source
> :>to my Linux workstation. I am compiling it with GNU COBOL. The results
> are
> :>amazing clean. Well, that is, not many errors. However I have run into
> one
> :>which is really confusing me. It is in a data definition. To boil it down
> :>to a basic level, consider the following, which is accepted by 3.4.1
>
> :>01 A
> :>     10 B
> :>          15 C1
> :>          15 C2
> :>      12 D
> :>           15 E1
> :>           15 E2
> :>       10 F
>
> :>The GNU COBOL compiler chokes on the "12 D", emitting the error message:
> :>
> ​​
> Warning: No previous data item of level 18
>
> Bug in compiler. No clue where 18 came from.
>

​My apologies. the 18 was in the original message. The example is not in my
code. I should have edited the message to read:​
​
Warning: No previous data item of level 12



>
> :>This message seem correct to me.
>
> There is no requirement that the levels be sequenced.
>

​I agree that the IBM manual makes no mention of this. But it seems to be
confusing when I look at it. I'm used to "matched" level numbers. So I
guess the following is acceptable?

01 SOME-DATA.
     02 LEVEL-2-A.
          03 LEVEL-3-A PIC ... .​
          05 LEVEL-3-B PIC ... .
          04 LEVEL-3-C PIC ... .
     02 LEVEL-2-B PIC ... .

If the above is not an actual error, then can we agree that it is a poor
practice due to being somewhat confusing? Sure is confusing to me!



>
>
> What is the error?
>
> --
> Binyamin Dissen <[email protected]>
> http://www.dissensoftware.com
>
> Director, Dissen Software, Bar & Grill - Israel
>
>
-- 

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to