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



Hi Mihael!

>my first question: is this list only for 
>rpg400 or also for rpg iv

RPG IV is very welcome here!

>my programm accesses to tables. one table is 
>read from top to bottom, every record, and 
>has about 15000 records. the second table 
>is accessed about every 10th record and 
>has only 30 records.
>
>would it be better to read the necessary data
>from the second table into a userspace object? 

For this specific example, I would say to let OS/400 handle the access.  On
a PC, 15,000 rows is a large database.  On iSeries, 15,000,000 rows is a
large database.  And 30 records is insignificant.  Because of the way OS/400
keeps recently used pages in memory, if you access the 30 record table often
enough, OS/400 will keep all the records in memory anyway, especially if
your program is running in a large memory pool.

>if so, how do i store and access it from the userspace object. 

There are a series of APIs that you would call to access user spaces and
user indexes.  Visit the IBM iSeries Infocenter to see the API manuals.
http://www.iseries.ibm.com/infocenter  David Morris has generously donated
source to the iSeries-toolkit that has user space and index functions in it.
http://www.iseries-toolkit.org

>or are there any other way to have
>less database access/workload. 

A more typical way for RPG programmers to cache their own data would be in
an array.  You might use a pre-run time array, sorted in key order and use
%lookup.

I hope this helped some,
  --buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.