Re: Really weird COBOL behavior
- From: "Chuck Stevens" <charles.stevens@xxxxxxxxxx>
- Date: Mon, 10 Oct 2005 09:55:21 -0700
"Mike" <MPBrede@xxxxxxxxx> wrote in message
news:1128738310.899590.179510@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I thought that OCCURS DEPENDING ON always allocated the maximum number
> of elements of the array and that the DEPENDING ON clause was simply to
> set a "High Water Mark" for things such as a SEARCH through the table.
No, it goes further than that. ANSI X3.23-1974, Page III-4, OCCURS General
Rule 4: "When a group item, having subordinate to it an entry that
specifies Format 2 of the OCCURS clause, is referenced, only that part of
the table area that is specified by the value of data-name-1 will be used in
the operation." That applies not just to the direct reference to the table
but also to its superordinate group.
This is clarified in the '85 standard to discuss the different scenarios
evolving when the item on which the OCCURS is depending is inside or outside
the record that contains the ODO item, and the record is being referenced as
a group. That standard also clarifies the combination of ODO and RECORD
VARYING.
Fundamentally, as I read the standards, if a record contains an ODO item,
no part of that record that lies beyond the entry in the ODO table denoted
by the item referenced by the ODO is accessible. How the individual
implementation handles memory allocation is defined, I believe, by the
implementor.
-Chuck Stevens
.
- Follow-Ups:
- Re: Really weird COBOL behavior
- From: William M. Klein
- Re: Really weird COBOL behavior
- References:
- Really weird COBOL behavior
- From: Mike
- Re: Really weird COBOL behavior
- From: William M. Klein
- Re: Really weird COBOL behavior
- From: Mike
- Really weird COBOL behavior
- Prev by Date: Re: Really weird COBOL behavior
- Next by Date: Re: Really weird COBOL behavior
- Previous by thread: Re: Really weird COBOL behavior
- Next by thread: Re: Really weird COBOL behavior
- Index(es):
Relevant Pages
|