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



Bryce:
SETOBJACC is used to load a file into memory. In my case, I have a couple files that rarely change, but they are accessed often. So I created a private memory pool to load them into so they always reside in memory, that way any access to the files will hit memory instead of the disk.

In regard to RPG validating data on a read, that was my understanding as well, however my belief in that has wavered. Our programs sometimes read records with bad numeric data. But the read doesn't result in an error. Accessing the field with the bad data, now that causes an error. Although we always read into data structures defined using LikeRec, so that may be doing something to prevent an error.

I have indeed started to think about using SQL. And in one particular case, I think I have no choice but to do so in order to get a performance boost.

And while I hate to say this, because it's not the way I generally work, at the moment I'm looking for a 'quick' answer for some of my other programs that simply read an entire file w/o using a key on the read, but the logical files are keyed.

With a recent change, the file in question has had its file length almost doubled. I'm guessing that means that our blocked reads are going to perform at 50% of what they were (since less records can be fit into a page). The default block size is 4k. I'm looking at OVRDBF SEQONLY to make use of the 128k page size the RISC system has. However, in my reading it talks about sequential vs keyed. Does this mean how I'm accessing it, or how the file's defined? We have a couple programs that read through an entire keyed logical (including select criteria) however it uses a plain old READ. I'd like to get this to BLOCK. (Hoping to test this soon.)

Thanks for the input everyone.

-Kurt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bryce Martin
Sent: Friday, June 04, 2010 3:02 PM
To: RPG programming on the IBM i / System i
Cc: 'RPG programming on the IBM i / System i'; rpg400-l-bounces@xxxxxxxxxxxx
Subject: Re: Speed in Reading

I'm not sure what SETOBJACC is or what effect it has on reading a file...
but....

Doesn't RPGLE do its checks on Read as opposed to SQL that does checks on
Write? So as I've heard it the general idea goes that reading with SQL
should be faster than RPGLE but writing would be the other way around. So
why not write and SQL to read the data and only the fields you need (which
is proven to be faster than specifying SELECT * FROM)? You can fetch more
than one row at a time I do believe and I think would perform better than
a single record by record read using native I/O.

Then again, if I have the idea of when the i/o checks happen respective to
read vs. write then everything I said above is for naught!


Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777



Kurt Anderson <kurt.anderson@xxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
06/04/2010 02:12 PM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>


To
"'RPG programming on the IBM i / System i'" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
Speed in Reading






Hi all,

Lately I've been dealing with a new client that has a high volume of data
for us to process, so I've been looking at various ways to get things
moving a little faster.

I believe I've successfully implemented the use of SETOBJACC with the help
of Chuck Pence & Mark Waterbury (thanks guys).

Now, this may be grasping at straws, but in a high data volume situation,
should I see any benefit in restricting the fields in a LF to only the
fields used by the program? (In essence, going from record length of 438
to 138.) My brain says, "yes," but the logic under-the-covers may not
match the logic my brain uses to come to its conclusion.

I'm also curious about RPG blocking. This question mainly goes out to
people using file encapsulation service programs, but is obviously open to
anyone to answer. I have a file wrapped up in a service program. This
service program pretty much handles all I/O operations for the file. Now,
if all I want to do is loop through the file, it's not going to block read
because it has operations such as READE in the service program. I wish
block-reading would be determined at run-time (again, a wish without a
full understanding of the compiler does its thing). I'm curious how
people have circumvented this limitation?

Thanks,
Kurt Anderson
Sr. Programmer/Analyst
CustomCall Data Systems

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.