Running the API (QUSLSPL) List Spool FIles

135 pts.
Tags:
API
IBM iSeries
RPG
I have downloaded an RPG example program where the program creates a user space with the API (QUSCRTUS) and then calls the API (QUSLSPL) to list spool files. This program runs fine I run it for *CURRENT as the user parm. I want to run it for *ALL users to get a list of all spool files on our system for all users. When I run it with *ALL in the parm, the program just runs for ever on the call to the"List Spool Files" API. I was wondering if anyone else had this problem running this API this way. Here is an example of my code. Any help is greatly appreciated. 0148.00 C* Call QUSLSPL to get all spooled files for *CURRENT user C CALL 'QUSLSPL' C PARM SPC_NAME C PARM 'SPLF0200' FORMAT 8 C*** PARM '*CURRENT' USR_PRF 10 C PARM '*ALL' USR_PRF 10 C PARM '*ALL' OUTQ 20 C PARM '*ALL' FORMTYP 10 C PARM '*ALL' USRDTA 10 C PARM QUSEC C PARM JOBNAM 26 C PARM KEYS C PARM KEY#

Answer Wiki

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

I suspect that while the API appears to be running forever, it’s more the case that it’s just taking a whole lot more time due to processing all spool files on the system as opposed to just the spooled files for one user. This API doesn’t return until it actually has the entire list — which can take a while. This API is also limited to only returning information that will fit into the 16MB user space you have created. If there are more spool files than will fit in one space you are out of luck as there is no way to ask for the “next” 16MB.

Assuming you simply have a very large number of spool files on your system I would recommend using the <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/qgyolspl.htm”>Open List of Spooled Files</a> API. This API has a few advantages that you might like:

1. The API can return as soon as it has X spooled files to return. You specify X. While you’re working on the first X entries, the API (in a background job) continues to build more list entries. When you’re done with X, you ask for X more.
2. The API is not limited to 16MB (assuming you are on a V5R3 or later release that is)

There are other advantages as well. Some of which are mentioned in the API documentation.

I hope this helps,
Bruce Vining
<a href=”http://www.brucevining.com/”>Bruce Vining Services</a>

Discuss This Question: 1  Reply

 
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
  • WoodEngineer
    We use that API with *ALL as part of a nightly routine to delete old spool files. Works well. Since it runs off hours I can not comment on the length of time it runs. The API does retrieve quite a bit of info so Bruce Vining's comment makes a lot of sense.
    6,725 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