So, your nightly backup or other important job is running and boom, a message arrives on the QSYSOPR message queue that the job has encountered a record allocation or object allocation problem, because some other job is holding a lock on the record or the object you need. You do a WRKOBJLCK (Work with Object Locks) command to see who has it, and send the offending user a message or kill the offending job so the important job can run.
Carsten’s command in this issue will do all this for you. The Process Object Locks (PRCOBJLCK) command identifies all jobs currently holding a lock for the specified object, and for each job, it either sends a break message or ends the job. The break message is sent to the job holding the lock or optionally to all jobs currently running under the user profile of the job holding the lock.
Download the save file containing the source code.