|
Record locks are usually, though not always, related to an interactive file maintenance program chaining to the table to display a record for potential changes, such as a name change. The lock will occur when some other program, whether interactive or batch, needs to update the same record. The second program blows off (record lock) because the user went to lunch (figuratively and literally) with the record still pending on their terminal.
The easiest way to prevent this is to:
* Do the first chain with the (n) extender.
* Save the record's contents to a data structure
* Re-chain, when ready to update, without the (n) extender,
* Compare the record's contents (at least the data elements the
interactive user can change),
* If the comparison fails.
o Abort the update
o Display an error message ("Too slow, Goldilocks.")
Unfortunately, most of us, self included, are usually too lazy to do the work necessary for steps 2+. But that's the real solution, Booth, because the problem is Cheryl in Sales or Morgan in Purchasing going off into LaLa Land.
* Jerry C. Adams
*IBM System i Programmer/Analyst
B&W Wholesale Distributors, Inc.* *
voice
615.995.7024
fax
615.995.1201
jerry@xxxxxxxxxxxxxxx <mailto:jerry@xxxxxxxxxxxxxxx>
Booth Martin wrote:
Do you know why the record is locking? Would it be easier to get rid of the problem in the first place??
KSwanso@xxxxxxxxxxxxxxxxxxxxx wrote:
Currently users are receiving this message in production. What I am trying to do is monitor for %status 1218 and use the Program Status Data Structure to get the Exception error information fields 91 - 170. Numerous posts on various forums indicate that this field should contain the a message along the lines of " Record 125059 in use by job 070608/USERNAME/WPDP609AS4."
However the only message that I see in fields 91 - 170 is: "Unable to allocate a record in file CDIARYP"
Here is a copy of my job log after the run with a locked record.
Record 125059 in use by job 070608/KSWANSO/WPDP609AS4.
? C Record 125059 in use by job 070608/KSWANSO/WPDP609AS4.
? C Unable to allocate a record in file CDIARYP.
Now it looks like I have responded to the record in use by job error message, but I am not responding, it appears to be doing it by itself...
Any suggestions on to how I can get it to either A, not auto reply to the error message, or B retrieve the prior message using the PSDS?
Thanks
Kevin Swanson
-----------------------------------------
The contents of this email may be confidential. If you are not the
intended recipient of this email, any access to, disclosure,
copying, or distribution of this information, is prohibited and may
be unlawful. If you receive this email in error please reply to the
sender immediately to advise him/her of the error, and then delete
this email and any attachments.
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.