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: Alain Lucari
Subject: Re: [open-cobol-list] CVS Update 20061015
Date: Tue, 17 Oct 2006 20:36:12 +0200

Hi Roger,

Really, I don't understand.
I don't use this clause "depending" on occurs, more or less
implemented in cobols compiler : I suppose that "4 to 6" give
6 in the most and if you have not (or have) the compiler source
what can you see ?

But, 4 to 6 depending on N should give 1, 2, 3 or 4 good
if N is  4.
And 1 to 5 or 6 Ok, if N is 5 or 6.
IMHO, you can't write that 3 if not good if N = 4, but
the compiler should retain 6 in this case and 4096 id the 
depending clauses is 1024 to 4096 depending of "anything".
This clauses was for the time whit no virtual memory, and
where cobol programmers was better than now.

As habitually, sorry for my bad english and
best regards,
-- 
Alain Lucari (Eurlix)


Le Tue, 17 Oct 2006 19:27:06 +0200
Roger While <address@hidden> a écrit:

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



reply via email to

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