IBM i Global

 View Only

 IBM i System Limit for Maximum Number of Spooled Files

Jump to  Best Answer
Aldrin Dela Cruz's profile image
Aldrin Dela Cruz posted Sun September 07, 2025 10:50 PM

Hi @Satid S,

What to monitor/check to know if the maximum number of spooled files on system is approaching system has reached 90% of 2.6 million spool files.

Thank you.

Best Regard,

-Aldrin

Kurt Thomas's profile image
Kurt Thomas  Best Answer

If you want to track just the overall number, the following SQL is probably the fastest way to get it:
select NUMBER_KEYS
    from QSYS2.SYSPARTITIONINDEXES
    where (TABLE_SCHEMA = 'QSPL')
          and (TABLE_NAME = 'QASPLINFO')
          and (INDEX_NAME = 'QASPDEVQ')

Satid S's profile image
Satid S

Dear Aldrin

I did a Google search with "ibm i maximum spooled files" and found that this article by the expert Dawn May should give you the answer: Get Notified When Nearing the Maximum Number of Spooled Files at https://techchannel.com/i-can-blog/get-notified-when-nearing-the-maximum-number-of-spooled-files/.  There are also several hot links in the article for more relevant information.      

These two Technotes are also useful:

IBM i System Limit for Maximum Number of Spooled Files at https://www.ibm.com/support/pages/ibm-i-system-limit-maximum-number-spooled-files.   

Alerts for IBM i System Limits at https://www.ibm.com/support/pages/alerts-ibm-i-system-limits.    Notice that you can change the % threshold for alert notification with simple SQL statement to the system's global variables. 

Kurt Thomas's profile image
Kurt Thomas

Do you just want to monitor the number of spooled files, or analyze where most spooled files are coming from, or ...?

Steven Riedmueller's profile image
Steven Riedmueller IBM Champion

Hi Aldrin,

Below are some queries that might help.  You can easily get the total count of spooled files using SQL.  If the number is quite high and you need to investigate further, I provided additional queries for retrieving a count per user, per job, etc.

--total count of spooled files in the system
select count(1from table (qsys2.spooled_file_info(user_name => '*ALL'));

--count per job name
select distinct job_name, count(1from table (qsys2.spooled_file_info(user_name => '*ALL')) group by job_name order by 2 desc;

--count per user profile
select distinct job_user, count(1from table (qsys2.spooled_file_info(user_name => '*ALL')) group by job_user order by 2 desc;

--count per output queue
select distinct output_queue_library, output_queue, count(1from table (qsys2.spooled_file_info(user_name => '*ALL')) group by output_queue_library, output_queue order by 3 desc;

--count per date
select distinct creation_timestamp, count(1from table (qsys2.spooled_file_info(user_name => '*ALL')) group by creation_timestamp order by creation_timestamp desc;