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