|
Hi, Vinay:
Consider that doing a SETLL followed by a test of an indicator and then
a READE requires two external program CALLs to the "database" routines
in the OS ... while doing a CHAIN requires only one external call to a
database routine within the OS.
Here we have some additional CALL "overhead" and if you are going to do
this "millions of times' that can add up.
So, if you can code it using a CHAIN, I would go that way.
But if you are going to position to a record and then read several
records with the same (partial) key, then it would make sense to do a
SETLL followed by a READE in a loop. Pseudocode:
SETLL
if Found then
READE
do while Found
... process the record ...
READE /* next record ? */
enddo
endif
Does that help?
Mark S. Waterbury
> On 10/14/2013 12:44 PM, Vinay Gavankar wrote:
Hi,is more efficient?
I know this has probably been hashed a lot of times, but which of this
times in a batch program.
Doing a direct Chain or a SETLL and if %EQUAL doing a READE
I am accessing on a full unique key, but performing this millions of
Most of the times the record WILL be found.
Thanks
Vinay
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.