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



Booth Martin wrote:

>With no filter set the subfile loads 
>quickly and happily.  However if the 
>user chooses to filter out  99.5% 
>of the records then loading the 10 
>records may take thousands of 
>reads to find 10 that pass.  In this 
>case the performance is dreadful.  

It sounds like you are doing a READ followed by a compare to see if the
record is desirable.  The system has to find the record, move it to a
machine buffer, move it to the RPG buffer, map the record into each field,
do the comparison and discard the lot.  That hurts.  

You want to move toward reducing the I/O load.  Some thoughts:

1) Use OPNQRYF to do the selection.
2) Use SQL to make the selection.
3) Use the minimum number of fields.
4) Define logical files so that you can always do SETLL/READE.
5) Have your program recognise the bad performing filter and read
sequentially using a large blocking factor.

What fits best depends on how much work you want to do to accommodate the
bad performer.  You may settle on a combination.  The idea is to:

a) Reduce the number of records you read in RPG.  The database is MUCH more
efficient at filtering records.
b) Reduce the record length of records you read in RPG.  The fewer fields,
the fewer mapping operations.
c) Use Blocked I/O - the system can keep that buffer full before your RPG
program needs a record.

To more directly answer your original question, change your display file to
FRCWRT(*YES) and every time you load a record into the subfile, WRITE the
control record.  The screen will display the (now longer) subfile.  

If you find that you need to interrupt the load process, you'll need to add
INVITE and a data queue to the display file.  Check the data queue after
each database READE. and put your interrupt logic there.

Buck Calabro
Aptis; Albany, NY
"We are what we repeatedly do.
 Excellence, then, is not an act, but a habit." --Aristotle


Billing Concepts Corp., a NASDAQ Listed Company, Symbol: BILL
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

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.