How do I delete Spool Files of a particular user for a specified date range. For eg. Spool Files of Rahul needs to be deleted for dates between 01/01/2009 and 30/07/2009. Kindly help since the Spool File Count for many users ranges from 4152 to 86592 and the same are not required & can be deleted. Deleting them using Option 4 on Work with Output Queue is a tedious task.
The Delete Old Spooled Files (DLTOLDSPLF) program is a program that can be used to delete old spooled files from an IBM System i products system. It also can be used to provide an example on how to code the Print and Spool APIs. DLTOLDSPLF No Longer Needed in V5R4M0 (5.4 or R540) i5/OS and Above 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.
I have a program that uses the QUSLSPL API to clean up my spoolfiles. It coul dbe a good starting point for your cleanup program. For info and examples on the API, just search the web.
The old school way was to do this in a CL program. First a WRKSPLF SELECT(TSTXML) OUTPUT(*PRINT) then CPYSPLF to a flatfile. Then RCVF the record, substring out the info, and if it meet the conditions, DLTSPLF and pass the parms jile /user/jobname/job#/ spool#.
Discuss This Question: 6  Replies
The Delete Old Spooled Files (DLTOLDSPLF) program is a program that can be used to delete old spooled files from an IBM System i products system. It also can be used to provide an example on how to code the Print and Spool APIs. DLTOLDSPLF No Longer Needed in V5R4M0 (5.4 or R540) i5/OS and Above 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.
Check the similar discussion delete a user’s spoolfile in batch by date range, Deleting outq spool files
Hope this helps.
For info and examples on the API, just search the web.