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



FYI - in case someone didn't know how READE worked (I had a misconception until working with Open Access for database).

READE is a READ, then test for Equal.

That means the file is read in its order, as Birgitta, et al., have said. Then the key fields are compared against the partial key values you provide.

This is maybe obvious, but somehow the details were not to me. It came out when I tried to handle a situation where I changed the partial key value midstream. I had thought the process would reposition according to those values. Of course, that's a CHAIN or SETLL, now that I've thought back on it.

But in an OA handler, I had to do this the right way. Getting into the nitty-gritty was definitely interesting!

Why would a person do this? I don't know that I had a scenario, just that it was possible and I had to handle it. I suppose something like skip-processing - get the first of each group of some kind. Hey, do level checks rear their ugly head here?

HTH
Vern

On 6/20/2013 12:12 AM, Birgitta Hauser wrote:
Contrary to SQL native IO always uses the predefined access path, i.e. the
access path located within the DDS described files or SQL Indexes that are
specified within the F-Specs.
No additional optimization occurs.
In this way reading with a partial key, will read the records according the
key definition (i.e. in your case ascending date).

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Jeff Crosby
Gesendet: Wednesday, 19.6 2013 20:54
An: RPG programming on the IBM i / System i
Betreff: READE with partial key

Suppose I have a file defined via DDL with unique key consisting of

Item (ascending)
Date (ascending)


// Set position in file
SETLL Item FILE;

// Only while this item
Dow '1';

Reade Item FILE;
If %EOF(FILE);
Leave;
Endif;

process record . . .

Enddo;

I am not assured of getting records within this item in ascending Date
sequence, am I? Some testing I'm doing now shows that I don't.



--
Jeff Crosby
VP Information Systems
UniPro FoodService/Dilgard
P.O. Box 13369
Ft. Wayne, IN 46868-3369
260-422-7531
www.dilgardfoods.com

The opinions expressed are my own and not necessarily the opinion of my
company. Unless I say so.
--
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 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.