× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Reminds me of a colleague back in the 70's programming in COBOL on a 370. Was having a devil of a time debugging a program; kept getting random results even though the data and program remained unchanged. Turns out, he said, that a program array was defined with X elements. Some variable was using something like X + 1. Unlike RPG's array index error, apparently the COBOL program (at least then) just said, "OK, if that's what you want, I'll resolve to that address and give you whatever I find."



        * Jerry C. Adams
*iSeries Programmer/Analyst
B&W Wholesale Distributors, Inc.* *
voice
        615.893.8633x152
fax
        615.995.1201
email
        jerry@xxxxxxxxxxxxxxx <mailto:jerry@xxxxxxxxxxxxxxx>



Jim Wiant wrote:

Ok, you got me on this one.
I'm pretty certain (although I can't prove it because the compiler and
code are long gone) that under MicroFocus COBOL for the PC that I did
prove that the system did physically expand the array when I defined it
as varying between x and y.
Memory would decrease if I increased y. I needed this cause I crammed
400,000 lines of COBOL into a 512K PC using dynamic overlays, and I
needed every byte I could get!

However, under the I-SERIES and COBOL ILE I've never tested the actual
physical memory to see if changing the array limits changed anything.
I'll take for granted you're right, and that some 'assumptions' are made
by the compiler.

In the regression and recursion routines I've done it sure 'acts' like
it does truly expand, but that could be just as you said - it's
pretending to.

I'll look forward to giving that a look on this system when I get a
chance.

Thanks

JPW





The bitterness of poor quality remains long after low pricing is
forgotten!


Cautillo, Leon M.




>> Also, you could consider calling an ILE CBL routine - because CBL
supports dynamic array. (And yes, I still like COBOL) - *LOL*

I hate to disillusion you, but no it doesn't.  It just pretends to.
It
always allocates the storage for the maximum size possible.  Since the
point
of a dynamic array is to reduce memory utilization this nullifies the
impact.

The only real difference is that any bound checking is done against
the
current limit and not against the maximum.  Many COBOL compilers don't
even
check the bounds anyway so even that is of limited utility.

This message has been sent from Foodstuffs (Auckland) Limited ("Foodstuffs").

The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy any copies.

The views and opinions expressed in this message may be those
of the individual and not necessarily those of Foodstuffs, and are not given or endorsed by it.

Please note that this communication does not designate an information system for the purposes of the Electronic Transactions Act 2002.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.