|
I wrote a little CL utility for an object we lock all the time from a menu. It would attempt to do an ALCOBJ and listen for CPF0000 in a MONMSG. In the error section it would then do a WRKOBJLCK on the object, which would allow the user to call others and tell them to exit the file they were trying to lock. The next command after the WRKOBJLCK would be another ALCOBJ. Also, don't make a mistake I often find myself doing. I have a number of 5250 emulations running, and will lock the file with one and then try to do something with it in another. The system locks the object for the job, not the user. When you do an ALCOBJ and accept the defaults, it locks the *FIRST member. Make sure you are locking the member you are trying to clear. But, why try to lock the file at all? Just do the CLRPFM and if the file is in use, then it will wait for a little time (I *think* that 60 seconds is the default) and then come back with an error. So then you could do a WRKOBJLCK, once everyone was out do the CLRPFM. CLRPFM puts an exclusive lock on the member it's clearing during the operation anyway. If you are trying to do this in a CL, make sure you MONMSG CPF0000 right after you do the ALCOBJ to look for any errors. Regards, Jim Langston Balaji.Rao@smed.com wrote: > Hi there, > I'm having some problem executing a CLRPFM . > I've obtained a EXCLUSIVE lock on the File Object, that I wanted to clear. > I used the following command to do that , and this command executed > successfully. > ALCOBJ OBJ((FILENAME *FILE *EXCL)) WAIT(600) > After this I did a CLRPFM which gives me an error saying "Member FILENAME > already in use" > Is there anything I'm missing. > Thanks. > > +--- > | This is the Midrange System Mailing List! > | To submit a new message, send your mail to MIDRANGE-L@midrange.com. > | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. > | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: david@midrange.com > +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.