|
Use DoW %status(file) <> 0 ... ... ... The %STATUS BIF has a nice assortment of values for differing circumstances and you can decide what to do based on the value of %STATUS. Also, IBM dropped a "gotcha" on us. %EOF is automatically set of before the OpCode in V5R1 but not in previous releases. If you're compiling to previous releases, the same BIF will provide different/incorrect results. This doesn't happen often, but it hurts when it does and it makes you wonder why it hasn't been PTF'ed back to previous releases. -----Original Message----- From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On Behalf Of Robin Coles Sent: Friday, October 05, 2001 2:10 PM To: rpg400-l@midrange.com Subject: READ(E) and locked records I've just been caught out by something that should have been obvious but we missed. I wondered what the best way to deal with it was With READ and an indicator, if the record happened to be locked the user got an error message that was ugly but allowed a retry. It happened so infrequently and recovery was so painless that we just accepted it. We've recently switched to using READ(E) and %EoF etc, using code similar to: Read(E) File Dow Not %EoF ... Some stuff here Update File Read(E) File EndDo but now we don't get the error message if there's a lock, and we fall through the DoW loop ending up with an update without prior read or chain. We could code DoW not %EoF and not %Error, but that's hiding the problem. I'd like to be able to give the user the option to retry. What does everyone else do? INFDS, register an error handler? Cheers Rob _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com 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.