IBM Support

QSPL Storage Cleanup Tips

Troubleshooting


Problem

This document provides suggestions on reducing the amount of disk space or DASD used to store operating system spooled files in the QSPL library.

Resolving The Problem

This document provides suggestions on reducing the amount of disk space or DASD used to store operating system spooled files in the QSPL library.

This list includes suggestions that will help to reduce the amount of disk space currently required to store spooled files and suggestions to prevent excessive amounts of DASD from being used to store spooled files in the future:
 
1. Do not delete any of the physical files or members in the QSPL library.

Caution: Each member in the QSPL library (or in the QSPL data base as it is sometimes called) stores a spooled file on the IBM System i products system or is marked for reuse the next time a spooled file is created by a program or application. Deleting a member in the QSPL library could arbitrarily delete a spooled file on the system. In addition, deleting a file in the QSPL library could arbitrarily delete hundreds or thousands of spooled files on the system.

The only way to clean up after deleting QSPL files or members and to have the output queues accurately list the spooled files that are still on the system is to IPL the system. If an IPL is not possible, running STRSPLRCL might help prevent some spooling and printing failures. However, STRSPLRCL does not fix up everything needed to recover from deleting a file or member.

STRSPLRCL OUTQ(*ALL) ASPGRP(*)
2. Use the Clear Output Queue (CLROUTQ) command to remove old job logs and system dumps from the QEZJOBLOG and QEZDEBUG output queues. The CLROUTQ command can also be used to remove spooled files from other output queues when all of those spooled files are no longer needed.
3. Use the Work with Output Queue (WRKOUTQ) command with the Output queue (OUTQ) parameter set to *ALL to identify other output queues that have a large number of spooled files. Then, delete all spooled files or clear the output queues that are no longer needed.
4. Consider changing or overriding your printer files to specify the Expiration date for file (EXPDATE) and Days until file expires (DAYS) parameters, and running the Delete Expired Spooled Files (DLTEXPSPLF) command periodically to delete spooled files that have reached their expiration date.

The Expiration date for file (EXPDATE) parameter defaults to *NONE, so typically no expiration date is set. However,the Expiration date for file (EXPDATE) and Days until file expires (DAYS) parameters can be set prior to generating spooled files by using the Change Printer File (CHGPRTF) or Override with Printer File (OVRPRTF) commands. For example:

CHGPRTF FILE(QPJOBLOG) EXPDATE(*DAYS) DAYS(30)
OVRPRTF FILE(QPJOBLOG) EXPDATE(*DAYS) DAYS(30) OVRSCOPE(*JOB)

These parameters can also be set or changed after a spooled file has been generated by using the Change Spooled File Attributes (CHGSPLFA) command or by taking Option 8 (Attributes) from the Work with Spooled Files (WRKSPLF) or Work with Output Queue (WRKOUTQ) commands.

The Delete Expired Spooled Files (DLTEXPSPLF) command can be run interactively, in a batch job, or through a job schedule entry. For example:

DLTEXPSPLF ASPGRP(*ALL)
SBMJOB CMD(DLTEXPSPLF ASPGRP(*ALL)) JOB(DLTEXPSPLF)
ADDJOBSCDE JOB(DLTEXPSPLF) CMD(DLTEXPSPLF ASPGRP(*ALL)) FRQ(*WEEKLY)
           SCDDATE(*NONE) SCDDAY(*ALL) SCDTIME(010000)
           JOBQ(QSYS/QSYSNOMAX)
           TEXT('Delete expired SPLFs on a weekly basis')

For more information, refer to the "Delete Expired Spooled files (DLTEXPSPLF)" topic in the IBM Knowledge Center:
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzalu/rzaludelexp.htm

Note: If the DLTEXPSPLF command is used but an expiration date has not been set in any spooled files or no spooled files have yet expired, this command will not remove any spooled files from the system.
5. Consider using the CLEANUP function within Operational Assistant to set up to automatically remove job logs (or QPJOBLOG spooled files) from the QEZJOBLOG output queue and to automatically remove service, program dumps, and other system output from the QEZDEBUG output queue after a specific number of days.

For more information, please refer to the following documents:
N1019551: Objects Cleaned Up by Operational Assistant Cleanup
6.
Consider using the Delete Old Spooled Files (DLTOLDSPLF) utility to remove spooled files over a specific age. The source code for the DLTOLDSPLF utility can be found in the Application Programming Interface (API) programming examples in the IBM Knowledge Center, which is available at the following Web site:
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/apiref/apiexdelsp.htm

Updated DLTOLDSPLF code can be found in the following document:
N1019285: Delete Old Spooled Files (DLTOLDSPLF) Sample RPG Program
Caution: The DLTOLDSPLF utility is not an Application Programming Interface (API) or a system-supplied program. It is an unsupported utility that can be used to delete old spooled files from a system.
7.
Use the Find Jobs with Big Spooled Files (FNDBIGSPLF) utility to identify large spooled files on the system, then determine whether they can be deleted.

Information on the FNDBIGSPLF utility, and a save file containing this utility, can be found in the following document:
N1015563: Find Jobs with Big Spooled Files (FNDBIGSPLF) Utility

Note: The FNDBIGSPLF utility does not automatically remove large spooled files. However, it can be used to identify them so they can be manually deleted if they are no longer needed on the system.
Caution: The FNDBIGSPLF utility is not an Application Programming Interface (API). It is an unsupported utility used to find big spooled files. If an operating system spooled file cannot successfully be found using this utility, IBM is under no obligation to diagnose nor fix this utility.
8. After a large number of spooled files have been deleted, the QSPLMAINT system job will work on issuing the Clear Physical File Member (CLRPFM) command for each of the members affected. This process is not instantaneous, so the size of QSPL might not be noticeably smaller until several hours after the spooled files have been deleted.
9. The QRCLSPLSTG (Reclaim spool storage) system value indicates the number of days to reclaim when spool storage is automatically reclaimed by the system. The recommended number of days to set in the QRCLSPLSTG system value is 8 days (the default value for this system value). If needed, this value can be temporarily lowered to handle a large number of spooled files that have been deleted, then set back after a few days.
10. When job logs are unlikely to be needed to diagnose potential problems, the job description for that job can be changed to set the Message logging (LOG) parameter to LOG(4 00 *NOLIST). For example, to change the QDFTJOBD job description in library QGPL, use the following Change Job Description (CHGJOBD) command:

CHGJOBD JOBD(QGPL/QDFTJOBD) LOG(4 00 *NOLIST)

That will prevent the job log from being written to a QPJOBLOG spooled file when the job ends for any job started using the QGPL/QDFTJOBD job description which can clutter the QEZJOBLOG output queue, provided the Change Job (CHGJOB) command is not used to specify LOG(4 00 *SECLVL).
11. If a job log may still be needed but a QPJOBLOG spooled file is not necessarily needed, then Pending Job Log support can be used instead.

The Change Job Description (CHGJOBD) command can be used to set the Job log output (LOGOUTPUT) parameter to LOGOUTPUT(*PND), for example:
CHGJOBD JOBD(QDFTJOBD) LOGOUTPUT(*PND)

The Change System Value (CHGSYSVAL) command can also be used to set the QLOGOUTPUT (Job log output) system value to *PND, which will setup to use the Pending Job Log support for any job descriptions that have the Job log output (LOGOUTPUT) parameter set to *SYSVAL. For example:
CHGSYSVAL SYSVAL(QLOGOUTPUT) VALUE(*PND)

Pending Job Log support can provide a way to keep the job logs available in case they are needed to diagnose any problems, yet can help to keep from generating too many QPJOBLOG spooled files in the QEZJOBLOG output queue.

Note: For more information, refer to the sections titled Information Concerning Pending Job Logs and Information Concerning the QLOGOUTPUT System Value below.
12. For more information on reclaiming spooled file storage, review the information and suggestions in the Reclaim Spooled File Storage Experience Report that is available in Adobe PDF format at the following Web site:
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/experience/spoolreclaimabstract.htm
13. For more information on performance issues with spooled file storage, review the information and suggestions in the Spool Performance Considerations Experience Report that is available in Adobe PDF format at the following Web site:
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/experience/spool_expreport.htm

Information Concerning Pending Job Logs

Pending job logs will remain available until either the pending job log is removed or the job log is written to a QPJOBLOG spooled file. If GO CLEANUP is used to remove job logs and other system output after a specified number of days, then it will also remove pending job logs for jobs that completed more than the specified number of days ago.

Pending job logs can be displayed by using the Work with Job (WRKJOB) command and taking Option 10 (Display job log, if active, on job queue, or pending), or by using the Work with Job Logs (WRKJOBLOG) command and taking Option 5 (Display).

Pending job logs can be written to a QPJOBLOG spooled file through System i Navigator, or by using the Work with Job Logs (WRKJOBLOG) command, taking Option 12 (Work with job), taking Option 40 (Change job), and then setting the Job log output (LOGOUTPUT) parameter to *JOBEND. You can also use the Change Job (CHGJOB) command, for example:

CHGJOB JOB(job-number/job-user/job-name) LOGOUTPUT(*JOBEND)

Information Concerning the QLOGOUTPUT System Value

Setting the QLOGOUTPUT (Job log output) system value to *PND, or setting the Job log output (LOGOUTPUT) parameter in a job description or in the Change Job (CHGJOB) command to *PND will cause the job log to remain associated with the job without being written to a QPJOBLOG spooled file. In this case, job logs will continue to take up DASD, just the DASD used will not be within the QSPL data base.

The QLOGOUTPUT system value and LOGOUTPUT parameter can be set to *JOBLOGSVR instead of *PND. In this case, job logs will be written to QPJOBLOG spooled files by the job log server, not by each job as it is ended. The use of *JOBLOGSVR will not help reduce the amount of DASD used to store spooled files, but can help where there are lock contention issues on either the QPJOBLOG printer file or the QEZJOBLOG output queue.

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"Print","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent;7.4.0;7.4;7.3.0;7.3;7.2.0;7.2;","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Historical Number

376534691

Document Information

Modified date:
18 December 2019

UID

nas8N1019109