PowerWire.eu

Independent IBM i, AIX and Linux news and tech tips for Europe and beyond

  • Home
  • News
  • Technical Articles
    • IBM i
    • AIX
    • Linux
    • VIOS
  • Subscribe
  • About Us
  • Contact Us
  • Advertise with PowerWire.eu

Who is using that IFS object?

June 1, 2021 by Steve Bradshaw 1 Comment

Sometimes the simplest of questions that come into our support desk can fill us with dread and before the advent of IBM i Services, finding out which job had a lock on a particular IFS object was definitely one such question.

Back in the olden days we would have to write a custom program or command to make use of the QP0FPTOS API.  It’s not that this required a degree in Nuclear Physics but it was time consuming and often it could take longer to get permission to write the code than to actually write the code itself.

IBM i Services to the rescue

Now that we have IBM i Services this whole process becomes child’s play. You simply find out the name of the IFS object you are interested in and put that in a simple SQL statement and you get a row back for each job that has a lock on the IFS object in question.

So, in the example below, I want to know who is editing a Stream File called “/home/rowton/script1.ftps”

select i.*

  from table (

      qsys2.ifs_object_lock_info(

        path_name => ‘/home/rowton/script1.ftps’)

    ) i;

The SQL result shows me that User “Brad” using session QPADEV0004 is the culprit

What if I’m running 7.2 of IBM i or older?

This particular IBM i service is only available from 7.3 onwards. If you are still running on an older version, well my first advice is of course to upgrade to a fully supported version of this wonderful operating system but if that is not possible, try the IBM advice at the link below to create your own customer WRKLCK command:

https://www.ibm.com/support/pages/sample-program-list-lock-information-ifs-objects

i-UG goes Hybrid

We are returning to the Mount Hotel in my home town of Wolverhampton for another Hybrid event on the 6th & 7th July, we hope to see you there.
For more details check out  www.i-ug.co.uk

Filed Under: IBM i, Technical Articles Tagged With: IBM i, IBM Power Systems

Comments

  1. Hari S says

    January 12, 2022 at 5:43 pm

    Nice, thanks for sharing

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Free monthly newsletter signup

News

Shield Advanced Solutions Ltd is excited to announce the release Version 2.0 of their Nagios Monitoring plugin for IBM i – AAG!  

Choose AAG to keep and 'eye' on their IBM i. Shield’s simple to install, highly functional solution for … [Read More...]

A screen a story – Sometimes a question mark is not enough

By now you must be getting used to seeing a new version of IBM i Access Client Solutions (ACS) every time a … [Read More...]

RPG Data-Gen Operational Code

Looking back at when I first started writing articles for PowerWire.eu nine years ago, I was bought onboard to … [Read More...]

More articles from this section

Quick Links

  • Advertise
  • Subscribe

Follow Us…

  • Email
  • LinkedIn
  • Twitter

Search This Website

Copyright © 2023 · Cue Communications · All Rights Reserved

Log in