Re: Really weird COBOL behavior



"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


.



Relevant Pages

  • Re: OO question
    ... not the entry already exists, I want to set-up some aspects of my object ... and make changes to it later depending on some condition. ... Anything you can do to a normal hash, you can do to an object. ... out of a reference to a scalar, an array, a filehandle, or pretty much ...
    (perl.beginners)
  • If statement referencing a VBA Form
    ... Can you use a field to reference a selection made on a VBA form? ... Depending on whether the Grantor is a person or company there are two ... On my vba form there are option buttons - individualor company. ...
    (microsoft.public.word.vba.general)
  • Re: Access VB and Serial Communication
    ... The following articles may be ... a good reference, depending on your exact needs. ...
    (microsoft.public.access.modulesdaovba)
  • Re: firefox error on page refreshing
    ... colored border on them depending on if they are selected or mouse ... or exists at the time) a reference to an element with the ID ... you are reading the id off an element and then using that to ...
    (comp.lang.javascript)