This command is in TAATOOL
Delete Old Spooled Files – TAA (DLTOLDSPLF)
There are also sample programs in the Information Center on how to perform various tasks using system APIs. One example, <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apiref/apiexdelsp.htm”>Deleting old spool files</a>appears to demonstrate how to do what you want. Examples are provided with OPM RPG, OPM COBOL, and C though it wouldn’t be difficult to “upgrade” to ILE RPG/COBOL.
Providing integrated solutions for the System i user community
In current releases of i5/OS, you can run CHGPRTF to specify EXPDATE(), and potentially DAYS(), to begin setting up more automated purging of spooled files. The DLTEXPSPLF command is used to delete spooled files that have reached expiration.