Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What to do when you have 100s of spool files to delete?

12,504 views
Skip to first unread message

Mr. K.V.B.L.

unread,
Jun 30, 2010, 3:35:18 PM6/30/10
to
or a 1000!

Scott Lindstrom

unread,
Jun 30, 2010, 5:29:55 PM6/30/10
to
On Jun 30, 2:35 pm, "Mr. K.V.B.L." <kenverybigl...@gmail.com> wrote:
> or a 1000!

Sounds like you need to write a CL program.

fight-the-good-fight

unread,
Jun 30, 2010, 8:57:07 PM6/30/10
to
Did you look at prompting DLTSPLF and using *SELECT? All spool entries
you select will be deleted and this can be based on several things
including selection by user or print device or forms type or User Data
or ASP.

Hope this helps,
ken

<a href="http://www.ilerpgprogramming.com">visit ile rpg programming</
a>


Marc Rauzier

unread,
Jul 1, 2010, 6:26:04 AM7/1/10
to
Mr. K.V.B.L. écrivait dans news:48c76592-a511-4457-8d0f-
3dc8b8...@b35g2000yqi.googlegroups.com ce qui suit:

> or a 1000!
>

Did you try to use System i Navigator ?

--
Cordialement
Marc Rauzier
(pour me répondre, ne pas utiliser le from mais le reply-to)

magopocoto

unread,
Jul 1, 2010, 9:13:06 AM7/1/10
to
Il 30/06/2010 21.35, Mr. K.V.B.L. ha scritto:
> or a 1000!

try to look for qpratools.

If I remember correctly, there's a cmd called DLTSPL or something like.

HTH

bye
marco

Mr. K.V.B.L.

unread,
Jul 1, 2010, 9:25:41 AM7/1/10
to
On Jun 30, 2:35 pm, "Mr. K.V.B.L." <kenverybigl...@gmail.com> wrote:
> or a 1000!

Thanks everyone. I did try to use Navigator but was getting some Java
exception thrown back at me (of course). Poking around using DLT* I
was able to piece together this command : DLTSPLF FILE(*SELECT)
SELECT(MYUSER). Worked like a champ.

CRPence

unread,
Jul 1, 2010, 11:51:26 AM7/1/10
to
On 30-Jun-2010 12:35, Mr. K.V.B.L. wrote:
> What to do when you have 100s of spool files to delete?
> Or a 1000!

For me, that depends on:
- which queue the spool files reside
- the care required for avoiding deletion of spools owned by
other users or jobs
- the spool file owner, or any of the other selection values
that are available on the the SELECT() parameter of the DLTSPLF
command; i.e. for use with FILE(*SELECT)

On a 5250 emulator session I can often selectively delete a
couple hundred spool files from a WRKSPLF or WRKOUTQ panel in well
under a minute; e.g. all CRTxxxyyy listings, except the
last\most-recent, of a particular spool file name. I mostly just
hold down the '4' key and press PgDwn occasionally, taking no care
to avoid spilling fours onto the command entry and occasionally
stopping or tabbing to blank any undesirable 4=Delete options. I
might instead selectively move only a small number of spool files
from one queue to another by using 2=Change and typing
OUTQ(OtherQueue) on the command entry area before Enter to perform
the move, and then just clear the OUTQ I was working with. IIRC the
GUI had a select-all feature for delete, and then paging through to
unmark any that should remain could be quick for more entries being
displayed per page.... but way too long since I used that.

Regards, Chuck

JTF

unread,
Jul 1, 2010, 1:09:09 PM7/1/10
to

if it is all in one outq - Use with caution as it does what is
says...clear the outq
CLROUTQ outq(YourOutQ)

If it is all under your name
DLTSPLF FILE(*SELECT)

If it is all for a different user(s)
DLTSPLF FILE(*SELECT) SELECT(UserID)

h.os...@gmail.com

unread,
May 8, 2014, 12:00:38 PM5/8/14
to
Den onsdagen den 30:e juni 2010 kl. 21:35:18 UTC+2 skrev Mr. K.V.B.L.:
> or a 1000!

WRKOUTQ *ALL Then 14 where U wamt tp clear the Q

Jonathan Ball

unread,
May 9, 2014, 1:59:38 PM5/9/14
to
On 6/30/2010 12:35 PM, Mr. K.V.B.L. wrote:
> or a 1000!
>

That depends. If they're all in one output queue, you might just clear
the output queue: CLROUTQ. That will delete every spool file in the
queue, so if that's not what you want, you'll have to do something else.

IBM i Navigator can be helpful, although the interface is a little slow.
You can select any number of spool files belonging to a multiplicity
of users and delete them all at once.

I wrote a utility for my company that uses the output queue and spool
file API programs to identify spool files eligible for deletion and
delete them. There is a control table that contains entries for output
queues and the number of days spool files in them should be retained.
If there is no entry for a queue, a default number of days is used. The
program calls an API to get a list of all the queues, then for each
queue in the list it calls another API to build a list of all the spool
files in the queue older than the delete-through date, and deletes all
the spool files in the list. The program runs nightly and deletes
hundreds or occasionally thousands of spool files.

jadw...@gmail.com

unread,
Feb 19, 2015, 8:39:48 AM2/19/15
to
On Wednesday, June 30, 2010 at 2:35:18 PM UTC-5, Mr. K.V.B.L. wrote:
> or a 1000!

After experimenting I found that I could clear the entire spool by doing the following:

DLTSPLF FILE(*SELECT) SELECT(*ALL)

Peter H. Coffin

unread,
Feb 19, 2015, 9:25:07 AM2/19/15
to
I would hope that after nearly five years, the original poster had
gotten his SPLFs deleted. :)

--
The pig is nothing but a giant dish which walks while waiting to be
served.
--Grimod de La Reynière

jadw...@gmail.com

unread,
Feb 19, 2015, 1:46:05 PM2/19/15
to
> --Grimod de La Reyni�re

Yeah, but people actually still utilize AS400 technology. So I gave that answer to throw out there for people who will stumble across this. I see a lot of AS400 used in many of the judicial systems... So it's still relevant. :-) I'd hope after five years he'd gotten his spools cleared out too... lol

A. Perry Nelson

unread,
Feb 20, 2015, 6:53:54 PM2/20/15
to
On Wednesday, June 30, 2010 at 3:35:18 PM UTC-4, Mr. K.V.B.L. wrote:
> or a 1000!

do wrkoutq, and do a option 14 to clear the outq. P

antonio.f...@gmail.com

unread,
Nov 24, 2015, 8:04:10 AM11/24/15
to
Em quarta-feira, 30 de junho de 2010 21:35:18 UTC+2, Mr. K.V.B.L. escreveu:
> or a 1000!

Hello All,

I already have the same problema, tan I found in the foruns (don't remember where) a program called DLTOLDSPLF that cold be schedulled with options like date to delete, user, queue, etc.....

Try to find it.... thats very usefull.

A. Perry Nelson

unread,
Dec 23, 2015, 6:19:31 PM12/23/15
to
what happened to clroutq command, good?!?!?!

vishal...@gmail.com

unread,
Jan 4, 2019, 7:37:01 AM1/4/19
to
On Thursday, July 1, 2010 at 1:05:18 AM UTC+5:30, Mr. K.V.B.L. wrote:
> or a 1000!

Now, Rdi is also an option to delete spool files.

Salty Salt

unread,
Jan 6, 2019, 11:40:40 PM1/6/19
to
Depends on the situation... DLTSPLF command with SELECT keyword might
help you out.

Jonathan Ball

unread,
Jan 19, 2019, 7:01:26 PM1/19/19
to
Always kind of amused when someone responds to a years-old post, but then
again, stuff changes in the interim.

Consider writing an SQL script and look at the IBM view
QSYS2.OUTPUT_QUEUE_ENTRIES. This contains all relevant data for every
spool file in every output queue on the system. I've written scripts to
delete, say, spool files older than six months for a particular user:


begin
for splfs cursor for
select *
from qsys2.output_queue_entries
where user_name = 'BSMITH'
and date(create_timestamp) < current date - 6 months
do
call qcmdexc ('dltsplf ' || spooled_file_name || ' job(' || job_name ||
') splnbr(' || char(file_number) || ')');
end for;
end


You could add all kinds of criteria to the WHERE clause of the cursor,
including multiple users, specific user data, minimum page size, etc.

You can also run an ad hoc query to find out which the most spool file data
by count or by size:

select user_name, count(*) splfs, sum(bigint(size)) tot_size
from qsys2.output_queue_entries
group by user_name
order by 2 desc

Ordering by the descending count will tell you who has the most, by
descending total size who is consuming the most space. You could add a
WHERE clause that would allow further refinement.

rramir...@gmail.com

unread,
Nov 20, 2019, 4:41:12 PM11/20/19
to
On Wednesday, June 30, 2010 at 2:35:18 PM UTC-5, Mr. K.V.B.L. wrote:
> or a 1000!

This is an old thread but hopefully this will help someone.

I wrestled with the same problem, hundreds thousands of splf to delete, could not do a CLR.

Tried iNav it would barf if you selected a large batch to delete, no better than copy / paste a column of 4s and ctrl V it.

Then a brainstorm... I use Mocha, most all emulators can do this...

Macro recording start, do a batch of column of 4 deletes, page down, more, etc. However many you want to do. End recording macro, assign to a key, boom, you have cut your keystrokes way back.

Caution, it can get out of control when you near the end of the ones you want to delete because its like dropping a big bomb and trashing everything, so be careful. Hope this helps.

Jonathan Ball

unread,
Nov 21, 2019, 1:58:01 AM11/21/19
to
I haven't used them, but there are utilities in TAATOOLS that will delete
spool files based on various criteria.

If you really want to get creative, you can write a SQL script that will
allow you to delete multiple spool files for multiple users from multiple
output queues according to almost as many criteria as you can imagine.
There is an IBM-supplied view, QSYS2.OUTPUT_QUEUE_ENTRIES. This has
entries for every spool file on the system. Start by running a simple
query to see what it yields:

select *
from qsys2.output_queue_entries

Most of the spool file attributes found in WRKSPLFA are available as
columns in the result set.

Once you're familiar with the columns available in OUTPUT_QUEUE_ENTRIES,
you can write a script to delete spool files according to whatever criteria
you wish.

begin
for splfs cursor for
select *
from qsys2.output_queue_entries
where user_name = 'BSMITH'
and date(create_timestamp) < current date - 6 months
do
call qcmdexc ('dltsplf ' || spooled_file_name || ' job(' ||
job_name || ') splnbr(' || char(file_number) || ')');
end for;
end;

The dynamic creation of the DLTSPLF command to be passed to QCMDEXC looks
awkward, but it shouldn't be too cumbersome for anyone who has done a lot
of concatenation in CL. The job name is already a fully qualified job name
of the form jobnbr/jobuser/jobname, so you don't have to string it together
from separate columns.

You could add all kinds of criteria to the WHERE clause of the cursor,
including multiple users, job queues, specific user data, minimum page
size, etc.

You can also run an /ad hoc/ query to find out which user has the most

mcalabrese...@scholastic.com

unread,
Mar 18, 2020, 1:36:06 PM3/18/20
to
Awesome! THIS was my answer! Thank you!
0 new messages