|
According to the ILE RPG Manual, even using the SETLL will cause blocking to be disabled unless the BLOCK keyword is used on the "F" spec. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Barbara Morris Sent: Tuesday, March 29, 2005 5:14 PM To: rpg400-l@xxxxxxxxxxxx Subject: Re: Chain doesn't set %EOF Paul Morgan wrote: > > Had a prior thread on DoW vs DoU read loops. > > Who the heck was the IBMer who said never to use ReadE? How long ago was > the Common conference? Possible old performance problems with ReadE? > > I doubt Barbara would agree with this recommendation to never use ReadE. > Right, I wouldn't, not that I'm an expert in database performance. While READE does prevent blocking, it does do the key comparison correctly (*). Using READ and checking the key yourself from the INFDS can get you into a mess if you have any special key features like ALTSEQ, ABSVAL, ALWNULL (see the READE documentation for the list of things that can cause a problem if you do a character-by-character key comparison). You can get mysterious results if you use a SETLL (which always sets %FOUND correctly) followed by a READ+compare (which might cause even the first record not to match). Even if you don't have special key features, and doing your own key compare would always be valid, you have to weigh the blocking benefit against the added complexity of your code getting the key value out of the INFDS, plus the hidden requirement that your keys never have any special features added. And remember that your code might be used as a pattern in some situation where the file does have special key features. (*) Only the ILE RPG (RPG IV) compiler does the READE key comparison (and SETLL EQ comparison) correctly. The RPG/400 (RPG III) compiler does a byte-wise comparison from the key in the feedback area, so using a READE in RPG/400 wouldn't have any _correctness_ benefit over your own READ + compare. -- 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 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.