× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I wrote my own SQLRPGLE program to do it.

This is my data source (I pass in number of days)

Exec Sql
Declare splcsr Cursor For
Select create_timestamp, spooled_file_name, job_name, file_number, size,
total_pages
From qsys2.output_queue_entries
Where days(current_timestamp) - days(create_timestamp) > :numDays
Order by create_timestamp;

Then loop through the results:

cmdstring = 'DLTSPLF FILE(' + splf.name + ') JOB(' + splf.jobname +
') SPLNBR(' + %char(splf.nbr) + ')';

// Exec cmdstring to delete spooled file
monitor;
qcmdexc(cmdstring:%len(cmdstring));
on-error;
Ifs_WriteLog(logFd:'CMD ERROR:' + TAB + %trim(cmdstring));
iter;
endmon;

HTH

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of James H. H. Lampert via MIDRANGE-L
Sent: Tuesday, September 12, 2023 1:21 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Cc: James H. H. Lampert <jamesl@xxxxxxxxxxxxxxxxx>
Subject: Two questions, Re: Getting rid of jobs and spool files

Ladies and Gentlemen:

1. I'd like to be able to quickly, quietly, headlessly, and
programmatically (preferably from CL) get rid of all jobs of a given
name (call it "FOOBAR" for now), whether SCD or ACTIVE. Surely this
can't be the first time this has come up. Is there an easy way to do this?

2. In the process of setting up an experiment for this, I discovered
that we had a server that was getting a steady stream of undesired
traffic in a protocol other than what it was expecting, with the result
that I had several thousand spool files, all from different (but
identically named) jobs. Is there a way to mass-delete these? All I
found was this:

<https://www.rpgpgm.com/2020/01/delete-many-spool-files-with-one-command.html>

which doesn't seem to address the "many different identically-named
jobs" part of the problem. Anybody have any suggestions for this?

--
JHHL

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.