Spool File Count From A Single Job?

1050 pts.
AS/400 Spool Files
Is there a way to determine the total spool file count that was generated from a single job (including spool files that have a 'FIN' status)?     We had a job that went into a loop and generated thousands (maybe hundreds of thousands) of spool files.     It is impossible to manually count them.     The problem is, the AS/400 has a limitation of 16.6 million spool files before it stops creating anymore (this has happened to us once before).     I am trying to identify the poorly written programs and provide an actual number of spool files that get generated from a job (FIN 'Finished Printing' status).


Answer Wiki

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

I think you can do this with RTVSPLFA
It allows you to specify Spooled file number . . . . . . *LAST
and get
Return spooled file number (6)


Sounds like you may want to do this after the fact and posibly not have a job name.
First, use the WRKSPLF command and specify output(*PRINT)
Note: you can get a subset of you use some of the options on the command or you can get everything.
Now, the output from that wil be a splf that you can copy to a database.
If you use the proper selection, you can just get the detail records.
Now, with SQL or QRY, you can sort the file by FIle Number, or do any other kind of interegation you would like to do,

What a compliment Whatis23 but it was CharlieBrowns idea that you’re expanding on .. mine, RTVSPLFA, may have died a glorious death?

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.
  • Whatis23
    Phil is correct as per usual. I would enter this command: WRKSPLF SELECT(*ALL) JOB(number/user/jobname) OUTPUT(*PRINT) CRTPF FILE(library/filename) RCDLEN(132) CPYSPLF FILE(QPRTSPLF) TOFILE(library/filename) JOB(number/user/QPADEVxxxx) You can then sql or qry
    5,665 pointsBadges:
  • TomLiotta
    "...spool file count that was generated from a single job..." That sounds like you know the name of the job that needs to be checked. I'm not sure if WRKSPLF, etc., will be reliable if you're approaching the limits on total spooled files. The only reliable count should come from the Open List of Spooled Files (QGYOLSPL) API. Even the more common List Spooled Files (QUSLSPL) API is going to choke if the number of spooled files is larger than around 120K files or so. Note that you wouldn't actually have to process any data coming back from the API other than the [Total records] value from the List information parameter. But if you know the job name, then WRKJOB JOB(jobname) OPTION(*SPLF) might be enough. If the list displays successfully, press <F18=Bottom>, then press <F11> until view #3 is shown. The last spool file number should show at the bottom of the list. If it doesn't crash the command, that should do it. Otherwise, the open-list API may be the only realistic choice. (I've seen excessive spool-file counts cause trouble, but not yet in V5Rx nor 6.1.) Tom
    125,585 pointsBadges:

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.

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


Share this item with your network: