Working with IFS Object Locks

APIs by Example

When you need to locate the jobs currently holding locks against a specific object in the library file system QSYS.LIB, you can immediately do so using the Work with Object Locks (WRKOBJLCK) CL command. However, we presently have no similar command for objects in the IFS. Other options already exist, though. One is IBM Navigator for i, which includes a GUI that provides access to IFS objects and lock information. Another option is a virtually undocumented facility based on the Perform Miscellaneous File System Functions (QP0FPTOS) API that produces a printed list of IFS object lock holders. (For more information about these options, see the related references in “Find Out More” below.)

Sometimes, however, speed is of the essence, and running a CL command from a command line clearly outperforms the aforementioned alternatives. Because both options employ the Retrieve Object References (QP0LROR) API to retrieve object lock information, I made a shortcut to exploit this API to implement a Work with IFS Object Lock (WRKIFSLCK) CL command. Using the code I present in this article also gives you a starting point to create, for example, a Check IFS Object Lock (CHKIFSLCK) command to verify whether a specific IFS object is currently in use. You can use the code to write other similar useful CL commands to support a workflow or process involving the use of IFS objects as well.

Download the save file containing the source code.

Read the entire article.

2 thoughts on “Working with IFS Object Locks

  1. The source for the WRKIFSLCK command is found in the TipSrc zip file pointed to in the article. The repective source members are named:

    Member      Type        Text                                             
    CBX254      RPGLE       Work with IFS Object Locks - CPP                 
    CBX254E     RPGLE       Work with IFS Object Locks - UIM Exit Program    
    CBX254H     PNLGRP      Work with IFS object Locks                       
    CBX254M     CLP         Work with IFS Object Locks - Build command       
    CBX254P     PNLGRP      Work with IFS Object Locks - Panel Group         
    CBX254V     RPGLE       Work with IFS Object Locks - VCP       
    CBX254X     CMD         Work with IFS Object Locks     


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s