How to check for file locks in Batch

4290 pts.
Tags:
AS/400
WRKOBJLCK
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

You could use ALCOBJ with a MONMSG

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    The List Object Locks (QWCLOBJL) API is probably the most common method of retrieving a list of locks for an object by programming. -- Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • fsddfsdfsd
    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
    60 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • LetItBe
    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.
    260 pointsBadges:
    report
  • aceofdelts
    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.
    1,975 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following