I had been looking around for a method to find out who was locking a specific IFS object, the problem came to light after some new programs we were developing crashed before closing the files (I thought when a program ended the file would be automatically released, but it looks like that may not be so with IFS and abnormal termination?) which resulted in the objects not being replicated by our replication software. There is no WRKLCK command or WRKIFSLCK etc so we needed a solution.
After some reading through the various API’s to determine what might be useful we did a quick search on Google. This came up with a very interesting solution, the article pointed to the QP0FPTOS API which is described in the manual with no reference to the call parameters the article suggested. So not being one to shy away we decided to give it a try. The command we ran was “CALL QP0FPTOS PARM(*LSTOBJREF ‘/home/ha4i/log/HA4I409_debug.dta’ *FORMAT2)”. This was pretty confusing because neither *LSTOBJREF was listed or the *FORMAT2 in the documentation! But it works! So if like us want to see what locks are against a particular IFS object give it a try! Just change the object to be checked of course :-)..
The output is directed to a spool file which can be viewed, we had hoped to be able to get the data back in soft copy to allow us to take some action, but for now we at least have some visibility of who is locking the object. Maybe we will ask IBM for more information on the API and how else it can be used..