Bsidmis,
How did the adding the extender to your chain operation work? Did it solve your problem?
Main Topics
Browse All TopicsDear All,
I am Trying to read the record in Update mode which is being locked by another program
I have added the Code in the program if the Particular record has locked then i have to display the Error message
/Free
Chain k1 filename;
If %Status=01218;
msg='Record Being Locked by Another User';
EndIf;
/End-Free
The Above Mention is the Code but it is not working
Can any one Suggest what Should i Do to solve the same
Regards,
Bsidmis
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Well of course there's the most-obvious way of using the CHGPFM command from the command entry screen to change the wait time on the file you're using:
CHGPF FILE(myfile) WAITRCD(5)
The above command would change the wait time on a file named "myfile" from the default of 60 seconds to 5 seconds; you could actually set it to as low as zero seconds, but whatever you set it to, that would become the wait time for the file *regardless* of what application is using it.
If on the other hand you would like to just change the wait times for the file in this one RPG program, your best bet would be to place on OVRDBF command in a CL program, and have that CL program call the RPG program. The OVRDBF command would look similar to the CHGPF command:
OVRDBF FILE(myfile) WAITRCD(5)
There are other ways of doing this, but these two would be the simplest.
Business Accounts
Answer for Membership
by: tclukayPosted on 2009-07-29 at 06:58:29ID: 24970225
I'm guessing that the CHAIN statement is still erroring out, right? This is because you are not monitoring for an error condition on the CHAIN, causing the program to abort before it ever gets to your statement containing the %STATUS built-in.
Your easiest solution is to place the operation extender on the CHAIN statement:
Chain(e) k1 filename;
Alternatively, you could put the CHAIN statement inside a MONMSG block and check the status code inside the MONMSG block. The operation extender is definitely the easier of the two solutions, however.