March 25, 2022

PRGSPLF – Purge IBM i Spool Files by Date

Share this

PRGSPLF – Purge Spool Files

The Purge Selected Spooled File(PRGSPLF) Command Deletes Spooled Files Based On Your Selection Criteria. Spools will be permanently deleted based on your criteria.

PRGSPLF - Purge Spool Files

Spooled File Name (SPLF)

Specifies the Spooled File(s) To Delete. The value can be a specific spooled file name or *ALL.

User Profile (USER)

Specifies the user profile that owns the spooled files. This can be a specific user profile or the special value *ALL.

Output Queue (OUTQ)

Specifies The Output Queue the spooled file(s) reside in. This can be a specific output queue or the special value *ALL.

User Data (USRDTA)

Specifies the user data for the spooled file(s) to delete. Valid values for this parameter are specified user data or generic user data (i.e. USR* will process all spooled files that start with the letters USR) or the special value of *ALL.

Purge Before Date (PRGDATE)

Specifies a Date To Purge Spooled Files Older Than The Passed Value. (i.e. if PRGDATE = 06252021, all spooled files created prior to June 25th 2021 will be processed).

You can enter shortcodes like *1MTH which means delete all spools older than one month old. The same rules applies to *3MTH, *6MTH, *9MTH, *1YEAR, *2YEAR etc. *ALL will delete ALL spools for the given user, outq and/or usrdata.

Example – me purging *ALL spools for my own profile

This is equivalent to entering the DLTSPLF *SELECT command

PRGSPLF

NOTE – the deleted spools will have storage reclaimed at next IPL or when you run the IBM-i System command RCLSPLSTG : The Reclaim Spool Storage (RCLSPLSTG) command reclaims unused storage for spooled files that have not been used for more than the number of days specified by the user. Spooled files are stored with database file members on the system. When a spooled file is deleted, the member is emptied but not deleted. Therefore, the member can be reused for the next spool file created. Reusing empty members improves the performance time when creating new spooled files. The RCLSPLSTG command deletes unused and empty database members in the specified ASP group. The QRCLSPLSTG system value can


UPDATE – March 2022

PRGSPLF has a new parameter added as part of the V7216 Release.

Changing this to a *YES will send the completion message to QSYSOPR, useful for logging spool purges in automated background processes.

The completion message might look like this:

PRGSPLF USER(CURRENT) PRGDATE('03/26/2022') 
PRGSPLF: 417 Spools purged successfully for USER(LITTENN) OUTQ(/ALL)
USERDATA(*ALL) DATE(03/26/22))

>