View previous topic :: View next topic |
Author |
Message |
meetrb Beginner
Joined: 24 Nov 2003 Posts: 40 Topics: 15
|
Posted: Fri Dec 12, 2003 11:26 am Post subject: Detecting Contention in a Rexx exec |
|
|
Hi,
I am writing a Rexx exec that will edit a member in a pds. But if that member is being edited by someone else I get a contention message. Is there any way I can prevent the message from being displayed.
I tried using OUTTRAP but it does not seem to be trapping the contention message.
Thanks in advance,
Ranjith |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Dec 12, 2003 3:11 pm Post subject: |
|
|
Ranjith,
what do you want to do when the member is in use by someother person? send a different message or open the member in browse/view mode? Here is a simple way to substitute BROWSE when the member is in use.
Code: |
/* REXX */
ADDRESS ISPEXEC
"CONTROL ERRORS RETURN"
"EDIT DATASET('datasetname(membername)')"
If rc = 14 Then,
"BROWSE DATASET('datasetname(membername)')"
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
meetrb Beginner
Joined: 24 Nov 2003 Posts: 40 Topics: 15
|
Posted: Mon Dec 15, 2003 9:46 am Post subject: |
|
|
Thanks for the reply Kolusu.
However my requirement was that I do not want the message to be displayed on the screen. The code I used was in my exec was,
ADDRESS ISPEXEC "EDIT DATASET(memname)
If memname is being edited by another user a contention message is displayed. I want to prevent the message from getting to the user.
Regards,
Ranjith |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Mon Dec 15, 2003 11:58 pm Post subject: |
|
|
Well "if rc = 14 then NOP" would do |
|
Back to top |
|
|
warp5 Intermediate
Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Tue Dec 16, 2003 2:35 am Post subject: |
|
|
I would like to add that you should place a:
EDREC INIT
before each edit. This will give you edit recovery - if your routine or tso or ... crashes you will reenter the edit where you last pressed enter - otherwise you might lose a lot of data that you entered. |
|
Back to top |
|
|
meetrb Beginner
Joined: 24 Nov 2003 Posts: 40 Topics: 15
|
Posted: Thu Dec 18, 2003 10:57 pm Post subject: |
|
|
Thanks for all the replies.
But I seem to have left my requirement unclear.
The requirement is that in a pds if there are members m1,m2,m3 .....
My routine would open m4 as the next member in the pds. However if another user is editing the member m4 and has not saved it as yet, I will be getting a contention message. I would like to prevent this message from getting to the screen and open up m5 without the user being aware of m4.
Thanks,
Ranjith. |
|
Back to top |
|
|
Mike Beginner
Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
|
Posted: Sun Dec 21, 2003 5:02 pm Post subject: |
|
|
Perhaps, if you were to show us the code that you are using we may be able provide more ueful information. _________________ Regards,
Mike. |
|
Back to top |
|
|
|
|