From: Richard on
> Certainly some of the other classics, such as tree traversal, aren't
> an easy fit for traditional COBOL. It's not hard to implement binary
> trees in COBOL, with or without pointers, but it's atypical.

What is usually done using trees in C is done using ISAM files in
Cobol, which may in fact be indexed by btrees, or by arrays and SEARCH
ALL (which may be a binary chop), or with relative files using the
record numbers as pointers.

The advantage of doing things in files is that these can be shared and
can be permanent which is important for business. If you want to
introduce Cobol do not teach recursion and btrees but teach the
difference between an invoice and a credit note.

From: Howard Brazee on
On 13 Jan 2006 11:48:16 -0800, "Richard" <riplin(a)Azonic.co.nz> wrote:

>What is usually done using trees in C is done using ISAM files in
>Cobol, which may in fact be indexed by btrees, or by arrays and SEARCH
>ALL (which may be a binary chop), or with relative files using the
>record numbers as pointers.


Kind of like teaching the difference between sorting an internal table
with a version of CoBOL that doesn't have a command for it, and a
version of CoBOL that does have a command for it.
From: Michael Wojcik on

In article <1137181696.726963.129770(a)z14g2000cwz.googlegroups.com>, "Richard" <riplin(a)Azonic.co.nz> writes:
> [I wrote:]
> > Certainly some of the other classics, such as tree traversal, aren't
> > an easy fit for traditional COBOL. It's not hard to implement binary
> > trees in COBOL, with or without pointers, but it's atypical.
>
> What is usually done using trees in C is done using ISAM files in
> Cobol, which may in fact be indexed by btrees, or by arrays and SEARCH
> ALL (which may be a binary chop), or with relative files using the
> record numbers as pointers.

Agreed - that's why I wrote that tree data structures are "atypical"
for COBOL.

Turing-completeness and the like aside, it's clear that programming
languages favor certain approaches over others, simply in the
syntatic sugar and semantic assistance they provide. The Algol
family of languages - such as C, Pascal, and their derivatives -
accomodate tree structures with little programmer inconvenience.
LISP and its derivatives encourage them; they're the basic data
structure provided by the language.

On the other hand, there are languages like APL, where the multidimen-
sional array is the basic data structure; the implementation may use
trees under the covers, but from the programmer's point of view they're
not a natural fit. And there's COBOL, where the basic data structures
are hierarchical records, arrays, and files.

> The advantage of doing things in files is that these can be shared and
> can be permanent which is important for business.

Obviously there are various tradeoffs between in-memory and on-disk
storage in most implementations, though unified virtual memory
management and hierarchical storage management are steadily removing
many of the distinguishing characteristics.

> If you want to
> introduce Cobol do not teach recursion and btrees but teach the
> difference between an invoice and a credit note.

Agreed, but as I noted in my response to Louis, introducing recursion
in COBOL is a different subject from introducing COBOL using recursion.

(And I certainly wouldn't try to teach B-trees, or B+trees, in COBOL;
they're not a natural fit and they're outdated.)

--
Michael Wojcik michael.wojcik(a)microfocus.com

If Mokona means for us to eat this, I, a gentle person, will become
angry! -- Umi (CLAMP & unknown translator), _Magic Knight Rayearth_
From: Rick Smith on

"Michael Wojcik" <mwojcik(a)newsguy.com> wrote in message
news:dqdtg901874(a)news1.newsguy.com...
[snip]
> (And I certainly wouldn't try to teach B-trees, or B+trees, in COBOL;
> they're not a natural fit and they're outdated.)

If those trees are *out*, what's *in*?



From: Howard Brazee on
On Sun, 15 Jan 2006 12:45:43 -0500, "Rick Smith" <ricksmith(a)mfi.net>
wrote:

>> (And I certainly wouldn't try to teach B-trees, or B+trees, in COBOL;
>> they're not a natural fit and they're outdated.)
>
>If those trees are *out*, what's *in*?

I suppose, external databases.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10
Prev: Data Representation in COBOL
Next: xml acucobol