Hi Buck,

When I said "compiled program code" I mean whatever the compiler does to
implement READE.  It would read the next sequential record, compare the keys
and then load the rcdfmt fields that the user code sees.

-Steve

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Buck
Sent: Monday, September 29, 2003 1:26 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: READE implementation difficulties. RE: When is %EOF not an
%EOF


> Without the need for the database engine
> to read and lock the next sequential record,
> couldnt READE be implemented solely in
> the compiled program code?

I'd need to do a READP in order to emulate READE in code.  Imagine this key
list:

Cust-Item
1-1
1-2
1-3
2-1
2-2

In a READE loop, limited to a partial key of CUST 1, when the runtime reads
customer 2, it gives me EOF and leaves the database fields in the program
intact.  That is, the program has the values from the last item of customer
1.

If I were to try that with READ/compare, when I READ customer 2, I now have
the values from the first item of customer 2.  I can set my internal EOF,
but I have the 'wrong' values and now need to do a READP to get them back.

Of course, the business rules may not give a hoot about whether the values
have been modified on our pseudo EOF, so that may be a non-issue for those
situations.
  --buck



_______________________________________________
This is the RPG programming on the AS400 / 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 ...

Follow-Ups:
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.