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
ASKED:
August 12, 2009 12:46 PM
UPDATED:
October 27, 2009 1:51 AM
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.
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