IBM Support

QSPL Storage Cleanup Tips

Technote (troubleshooting)


Problem(Abstract)

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 document was last updated on 29 May 2014.

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 CALL QSPFIXUP might help prevent some spooling and printing failures. However, QSPFIXUP does not fix up everything needed to recover from deleting a file or member.

Note: QSPFIXUP is no longer supported in V6R1M0 (R610) i5/OS and has been replaced by the Start Spool Reclaim (STRSPLRCL) command. The STRSPLRCL command can be used to repair output queues and spooled files that are left in unrecoverable states. It can be run for a single output queue, a set of output queues using a generic name (such as PRT*) or for all output queues in the auxiliary storage pool (ASP) defined by the ASP group (ASPGRP) parameter. For example, the STRSPLRCL command can be run for all output queues in the auxiliary storage pool (ASP), for example:

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.

Note: If you use IBM iSeries Navigator and are running R520 iSeries Access for Windows or higher, go to Work Management > Output Queues. This generates a list of output queues that corresponds to doing a WRKOUTQ OUTQ(*ALL). iSeries Navigator has the benefit that you can click on the Files on Queue column header to sort the output queues by the number of spooled files on each output queue. If the Files on Queue is sorted in descending order, the output queues with the most spooled files will be at the top of the list. Therefore, you can start deleting individual spooled files or clearing entire output queues with the largest number of spooled files first. This can be particularly helpful if there are thousands of output queues and you do not want to scroll through output queues that have few, if any, spooled files.
4. If running IBM i 5.4, 6.1, 7.1 or 7.2, 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 i5/OS Information Center:

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/cl/dltexpsplf.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. If running V5R3M0 (R530) i5/OS or earlier, 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 iSeries Information Center, which is available at the following Web site:

http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/apis/apiexmp.htm#Header_3

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.

Note: The DLTOLDSPLF utility will still run in V5R4M0 (R540) i5/OS; however, it is no longer needed in V5R4M0 because of new support for setting an expiration date on spooled files. After the expiration date is reached on the spooled files, they become eligible for removal from the system by the Delete Expired Spooled Files (DLTEXPSPLF) command.
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 running V5R4M0 (R540) or V6R1M0 (R610) i5/OS, and if a job log may still be needed but a QPJOBLOG spooled file is not necessarily needed, then the new 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 iSeries Reclaim Spooled File Storage Experience Report that is available in Adobe PDF format at the following Web site:

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/experience/spoolreclaim.pdf
13. For more information on performance issues with spooled file storage, review the information and suggestions in the iSeries Spool Performance Considerations Experience Report that is available in Adobe PDF format at the following Web site:

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/experience/spool_performance.pdf

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.


Cross reference information
Segment Product Component Platform Version Edition
Operating System IBM i 7.2
Operating System IBM i 7.1
Operating System IBM i 6.1

Historical Number

376534691

Document information

More support for: IBM i
Print

Software version: 5.2.0, 5.3.0, 5.4.0, 5.4.5, 6.1, 6.1.0, 6.1.1, 7.1, 7.1.0, 7.2, 7.2.0, Version Independent

Operating system(s): IBM i

Reference #: N1019109

Modified date: 05 November 2015


Translate this page: