• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Discovering Which Locked Object is Holding Up Your Job

    December 15, 2010 Hey, Joe

    I have a recurring problem with file locks on my system, where critical jobs are stuck in lock waiting status (LCKW) waiting for an object before crashing on a file allocation error. How can I tell which object the job is waiting for before it crashes and which user has that object locked? I’m running i5/OS V5R4M5.

    –Brett

    There are two ways to figure out which locked object a job is waiting for. One way to locate it is by using i5/OS green screen commands; the other is by using iSeries Navigator (OpsNav). Here’s the drill for locating your locked object or record using either technique.

    On the green screen, use the Work with Job (WRKJOB) command to view the job that is waiting on a record or file lock.

    WRKJOB JOB(job_name)
    

    On the Work with Job screen that appears, select option 12 (Work with Locks) to see all the file locks the job is currently holding or requesting. You’ll see a screen that looks something like this.

    Look for any entry that has a status of REQ (Request) with a member lock that says WAIT. In this case, my job is waiting for the SOURCE file in library JOEHTST. You can then run the following Work with Object Lock (WRKOBJLCK) command to determine who is holding the lock.

    WRKOBJLCK OBJ(library/object_name) OBJTYPE(*FILE)
    

    And this should tell you the name of the job that is locking your file. However, WRKOBJLCK doesn’t always provide the name of the locking job. There have been times when I’ve run WRKOBJLCK and it doesn’t let me see the name of the locking job. It just hangs and I can’t get any information. In that case, you just have to wait for the job to resolve the lock or try to locate the locked object by using OpsNav.

    To perform the same process in OpsNav V5R4Mx, open the Work Management→Active Jobs node under your target partition. You’ll see a screen that looks something like this.

    Right-click on the job that’s waiting for a lock and select Details→Locked Objects from the pop-up menu that appears.

    Like its green-screen counterpart, the OpsNav Locked Objects screen will also show you the list of objects that the job is either currently holding or requesting.

    Look for the object that has a Lock Status of Requested. Right-click on the object and select Lock Holders from the pop-up menu that appears. This will display a screen that shows which jobs are currently locking the object your job is trying to access. You can then make a decision on how best to proceed.

    If you have the programming knowledge or third-party software that can detect and react to job messages when they occur, you can also configure your system to automatically answer your file or record allocation errors whenever they appear. We recently set up a system to do this by using Bytware’s MessengerPlus. Inside MessengerPlus, we set up a QSYSOPR message queue monitor to look for a specific error message that occurred whenever a job crashed because it was unable to obtain a locked record. We monitored for the following error message:

    RNQ1218 - Unable to allocate a record in file &7 (R C G D F)
    

    We configured the monitor such that when MessengerPlus detected an RNQ1218 allocation error message in QSYSOPR, it would respond with up to three R (Retry) responses within 15 minutes before alerting the operations staff that there was a problem with the system. We set the monitor up to check for RNQ1218 messages every minute to catch these errors as they occurred. If three R responses didn’t solve the problem, MessengerPlus would text the Operations staff for help.

    If you don’t have third-party software that can be used to auto-answer these messages, you may be able to write a custom program that will retrieve and send retries R responses to the QSYSOPR messages, the same way that I was sending retries through my MessengerPlus software.

    If you decide to set up an automatic retry routine for your file allocation messages, there’s an easy trick for viewing all your QSYSOPR inquiry messages along with how each message was answered, as well as who answered each message. To get a listing of all your inquiry messages and their replies, run the following green-screen Display Message (DSPMSG) command.

    DSPMSG MSGQ(QSYSOPR) OUTPUT(*PRINT) MSGTYPE(*INQ)
    

    This will produce a spooled file containing all the current and answered inquiry messages on your system, as well as what reply was sent to each message and who sent the reply. This spooled file can come in handy when you’re trying to determine if your auto-answer routine is working correctly. For more information on creating and interpreting the QSYSOPR inquiry message spooled file, check out my article on Solving i5/OS Inquiry Message Whodunits.

    HTH

    –Joe



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Share on Reddit (Opens in new window) Reddit
    • Share on Facebook (Opens in new window) Facebook
    • Share on LinkedIn (Opens in new window) LinkedIn
    • Share on X (Opens in new window) X
    • Email a link to a friend (Opens in new window) Email

    Tags:

    Sponsored by
    FalconStor

    Simplify Secure Offsite Data Protection for IBM Power with FalconStor Habanero™

    IBM i teams are under growing pressure to ensure data is protected, recoverable, and compliant—without adding complexity or disrupting stable environments.

    FalconStor Habanero™ provides secure, fully managed offsite data protection purpose-built for IBM Power. It integrates directly with existing IBM i backup tools and processes, enabling reliable offsite copies without new infrastructure, workflow changes, or added operational overhead.

    By delivering and managing the service end-to-end, FalconStor helps organizations strengthen cyber resilience, improve disaster recovery readiness, and meet compliance requirements with confidence. Offsite copies are securely maintained and available when needed, supporting recovery, audits, and business continuity.

    FalconStor Habanero offers a straightforward way to modernize offsite data protection for IBM i: focused on simplicity, reliability, and resilience.

    Learn More

    Share this:

    • Share on Reddit (Opens in new window) Reddit
    • Share on Facebook (Opens in new window) Facebook
    • Share on LinkedIn (Opens in new window) LinkedIn
    • Share on X (Opens in new window) X
    • Email a link to a friend (Opens in new window) Email

    Sponsored Links

    VAULT400:  Which is right for you? Online back-up, DR, HA Webinar. Jan. 20
    Townsend Security:  FREE Podcast! Key management best practices: What new PCI regulations say
    Help/Systems:  Robot/SCHEDULE Enterprise, the job scheduling and server management tool

    IT Jungle Store Top Book Picks

    BACK IN STOCK: Easy Steps to Internet Programming for System i: List Price, $49.95

    The iSeries Express Web Implementer's Guide: List Price, $49.95
    The iSeries Pocket Database Guide: List Price, $59
    The iSeries Pocket SQL Guide: List Price, $59
    The iSeries Pocket WebFacing Primer: List Price, $39
    Migrating to WebSphere Express for iSeries: List Price, $49
    Getting Started with WebSphere Express for iSeries: List Price, $49
    The All-Everything Operating System: List Price, $35
    The Best Joomla! Tutorial Ever!: List Price, $19.95

    End of Year Miscellanea Oracle’s Withdrawal of JDE ‘Blue Stack’ Raises Questions

    Leave a ReplyCancel reply

Volume 10, Number 38 -- December 15, 2010
THIS ISSUE SPONSORED BY:

SEQUEL Software
neuObjects
inFORM Decisions

Table of Contents

  • Make SQL Edit the Way You Want It To
  • End of Year Miscellanea
  • Discovering Which Locked Object is Holding Up Your Job

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • IBM Goes GA With Power Autonomous Operations
  • IBM Wheels And Deals To Sell Power Systems, Storage, and Software
  • Guru: When RNF0722 Won’t Let Your Legendary RPG Program Compile
  • A Read-Only MCP Server For Db2 for i
  • IBM i PTF Guide, Volume 28, Number 35
  • Please Take The IBM i Marketplace Survey So We Know What You Know
  • IBM’s Bob AI Assistant Can Now Live In Your Datacenter
  • Start Where the Data Lives: Best Practices for Taking IBM i Into AI
  • Guru: A Modernization Experiment Using IBM Bob 2.0
  • How Are IBM i Shops Using AI? Fortra and COMMON Want to Know

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle