On Wed, 02 Apr 2008 05:41:02 GMT, "William M. Klein"
<wmklein@[EMAIL PROTECTED]
> wrote:
>It does have a "limit" - but it still needs to "move" the following data.
(Of
>course in Standard COBOL there can't be data following an ODO). "for
contiguity"
>of items, see,
>
>"8.5.1.8.1 Contiguity of data items
>A variable-length data item may be part of any group structure, and its
>neighbors may be non-variable-length data
>items or variable-length data items. A variable-length data item is
logically
>but not necessarily physically
>contiguous with its neighbors. However a variable-length data item
behaves in
>all respects as though it were in fact
>contiguous with its neighbors whenever a procedural operation is applied
to a
>group containing it."
>
>In other words, no matter how direct items are stored, if you process the
"group
>item" containing them, it must "appear" as if the following items are
directly
>after the current length - not after the MAXIMUM length.
The next paragraph seems to confirm that, when it qualifies any-length
with indirect. The
implication is that a change to a direct any-length item DOES affect the
addresses of its
neighbors.
"The physical address of a variable-length data item may change during
execution of the
program. Dynamic-capacity tables and indirect any-length elementary items,
however they
may change during execution, do not in any way affect the addresses of
their neighbors."
What procedural operations are they referring to? A MOVE and comparison
would work if the
maximum length were allocated and following items not ****fted. I can think
of two
situations where it matters. FUNCTION LENGTH says nothing about
variable-length groups,
which seems like an error. Reference modification cannot be used on
variable-length
groups.
How can a program tell whether the item following an any-length elementary
item is
contiguous? What behavior would be different?
Suppose program A calls B with the address of an indirect any-length item
or
variable-length group containing a direct any-length item. B changes the
item's size and
address. How does A know the new address? The parameter passed was the
address of the item
or group, not the address of its base pointer. If a Cobol program did pass
the addess of
the base pointer, which it would almost have to, that would cause problems
for other
languages, including the OS API.


|