× 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.



One thing that I also often have encountered is the problem: How big do I make the array (how many elements)? So we need an array which resizes itself if needed.

IBM has not given the RPG programmer anything like lists (f.e. linked lists) or maps (f. e. hash maps). There are some who made their own implementations for example:

http://www.tools400.de/English/Freeware/Service_Programs/Basics/basics.html
http://www.rpgnextgen.com/index.php?content=llist
http://www.rpgnextgen.com/index.php?content=vector


-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von David FOXWELL
Gesendet: Mittwoch, 3. Juni 2009 11:22
An: RPG programming on the IBM i / System i
Betreff: Array vs file access

Hi all,

We have some old RPGIII that are using arrays instead of files. These programs are used by a lot of different applications and can be called many times by the same program. The programs in question load a file into an array in the INZSR, then each time the program is called, it's the array that is searched instead of the file. Apparently, this is or was supposed to be quicker. The program however, needs to be maintained as eventually the arrays get overfilled as records get added to the file.

Is this kind of thing justified? If not, was it ever?

The boss is saying that it is not, because repeatedly chaining to the same record by different calls to the program would mean that the record would always be available in memory without having to read from disk. I think that's possible, but no way of knowing for sure. When the program was written, only 50 records were in the file. Now there are more than 800.

For now, I'm going to increase the size of the array in the program that's causing problems. I was thinking, however, that this program would be an ideal candidate for our shop's first ever service program, as all our RPGIV do a bound call to this program via an encapsulating program.

Any thoughts?



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.