Access to ‘object in use’ attribute of IFS object from QSYS RPGLE

5580 pts.
Tags:
i5/OS
IFS
IFS objects
iseries v5r4
QSYS
RPGLE
If you open a document which is stored in the IFS with OpenOffice, examining the object with Navigator allows you to see the 'in Use' property - it says that there is 1 Netserver reference.

Examining DSPLNK for the same object shows no such 'in use' attribute.

How do I get to that attribute in RPG?

I need to check to see if another job is currently using the object. I suspect an API may be involved? there appears to be nothing about the object itself which I can access using 'normal' streamfile read/write/authority tools.



Software/Hardware used:
iSeries i5/OS v5r4

Answer Wiki

Thanks. We'll let you know when a new response is added.

Yes there is an IBM API program for this:

CALL QP0FPTOS PARM(*LSTOBJREF ‘/ifspath/ifsfile’ *FORMAT2)

It will produce a detailed spooled file report with all the jobs that have a lock on that IFS object and the type of lock they have.

=============================================================

You probably want the Retrieve Object References (QP0LROR) API. I think IBM first supplied decent documentation in V5R4: Retrieve Object References (QP0LROR) API.

It’s not trivial. I think I can supply an ILE CL example. (If you can read CL, you ought to be able to convert to any other language.)

Tom

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Yorkshireman
    Thanks for that. The only problem is that it's a program, and that to get usab;e results would mean the old route of CPYSPLF and a parser program to read back the results. Even encapsulating all of that into a single RPG pgm, using User open of the SPLF, what you get is a clunky piece of work that lacks the elegance we look for in ILE. We already have and use a clunky solution (!) To call this program you must have *SERVICE special authority too, so implementing it would mean having to adopt authority, and auditors will ask 'why does this. . . blah blah - the way auditors do (for they lack both imagination and knowledge) Adopt my own oft repeated advice and RTFM - some reserach is needed, but as ever, there's no time left in this project for an unforseen issue.
    5,580 pointsBadges:
    report
  • hafwhit
    If you are only wanting to see if the file is in use you might be able to use the Open Stream File (QHFOPNSF) API and check for an error message code to see if it is in use. I have not used this API but have used similar ones to fine the status on other types of objects. I would assume the file is not in use if you did not get an error on the open. You may need to follow up with the Close Stream File (QHFCLOSF) API when finished. You can search the V5R4 API's at the API finder page
    1,145 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following