Hi,
I would like to check for locks on a PF/LF and need to send message to corresponding user. So, I cant use WRKOBJLCK as it will act interactively or Print the locks.
Please suggest me if there is any alternative to check for file locks.
Thanks,
Pradeep
Software/Hardware used:
ASKED:
December 31, 2012 5:43 AM
UPDATED:
December 31, 2012 12:57 PM
The List Object Locks (QWCLOBJL) API is probably the most common method of retrieving a list of locks for an object by programming. — Tom
The Retrieve Lock Information (QWCRLCKI) API could also be used, but it is less widely known. It can be simpler for some cases since it returns its results in a receiver variable. — Tom
You can use WRKOBJLCK to find all locks.Note it down some where and then use sndbrkmsg ,F4 then mention all work station that You have noted.You can send anu text message to all workstation
You can use WRKOBJLCK to find all locks.Note it down some where…
Since the request is to do it in batch, how do you recommend that the results be “noted down”?
Tom
Here is a scenario we handle in a couple batch jobs that run everyday. If the batch job encounters a record lock, a message is sent to our operator so that she can resolve the record lock, answer the message so batch processing can continue.After the i-o operation in the batch job – we check for record lock – if lock is encountered, the above described routine is performed. If you are interested is this – I could post more information.
In general, I place an exclusive lock on the file with a MONMSG for unable to place the lock. If the MONMSG hits then the file is in use.
I’ll typically keep the lock on until the special process (reason for testing lock in the first place) is finished. Then remove the lock.