gnucobol-users
[Top][All Lists]
Advanced

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

Re: [open-cobol-list] CVS Update 20061015


From: Roger While
Subject: Re: [open-cobol-list] CVS Update 20061015
Date: Tue, 17 Oct 2006 19:27:06 +0200

And this is perfectly correct.
Your table is specifically defined to only allow a subscript of
4, 5 or 6.
Therefore a reference X(3) is invalid.
(A compile time check)

Here's what the standard says -

-----
The value of the data item referenced by data-name-1 represents
the current number of occurrences of the subject of the entry.
The subject of this entry has a variable number of occurrences.
The value of integer-2 represents the maximum number of occurrences
and the value of integer-1 represents the minimum number of occurrences.
This does not imply that the length of the subject of the entry is variable,
but that the number of occurrences is variable.
At the time the subject of entry is referenced or any data item subordinate
or superordinate to the subject of entry is referenced, the value of the
data item referenced by data-name-1 shall fall within the bounds from
integer-1 through integer-2.
If the value of the data item does not fall within the specified bounds, the
EC-BOUND-ODO exception condition is set to exist.
The content of a data item whose occurrence number
exceeds the value of the data item referenced by data-name-1 is undefined.
 -----

Roger


   I down loaded and built the latest release of the Open Source COBOL
Compiler. I would expect the following program to compile:

       IDENTIFICATION   DIVISION.
       PROGRAM-ID.      prog.
       DATA             DIVISION.
       WORKING-STORAGE  SECTION.
       01 G.
         02 X           PIC X OCCURS 4 TO 6 TIMES DEPENDING ON N.
       01 N             PIC 9 VALUE 4.
       PROCEDURE        DIVISION.
           DISPLAY X(3).
           STOP RUN.

However, I get a compile time error stating that the subscript for X is
wrong.

Bob Sherry

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Roger
While
Sent: Sunday, October 15, 2006 5:57 AM
To: address@hidden
Subject: [open-cobol-list] CVS Update 20061015

CVS updated.
Tarball (AKA Prerelease) at :
http://ww.sim-basis.de/open-cobol-0.33.tar.gz

Too many things changed to list here.
See the ChangeLog files in the top-level
and sub-directories (cobc, libcob, config, bin, tests)

Roger



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list





reply via email to

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