×

Good News Everybody!

A new search engine is coming soon.

As a stop gap measure, we are using Google's custom search engine service.




My operator has been 'parking' unwanted spooled files and decided he
wanted to get rid of some, but not all of them. I have access to the
DB2 services that let me peep into an output queue with SQL, so I
whipped up a quickie to let my operator mass delete what he wanted to.
He uses PDM/SEU, so it's easy for him to take a 2 to edit, then an 'RX'
(strrexprc) and execute it.

/* Use the DB2 service to find the spooled files to be deleted */



ADDRESS EXECSQL

EXECSQL "SET OPTION COMMIT=*NONE"



/* Interesting columns: */

/* output_queue_name */

/* output_queue_library_name */

/* spooled_file_name */

/* user_name */

/* user_data */

/* create_timestamp */

stmt = "select spooled_file_name, job_name, file_number",

"from qsys2.output_queue_entries",

"where output_queue_name = 'QPRINT'",

" and output_queue_library_name = 'QGPL'",

" and spooled_file_name = 'QPDSPJNA'",

" and user_name = 'QSECOFR'",

" and date(create_timestamp) <= '2017-01-01'"



execsql "prepare S1 from :stmt"

execsql "declare C1 cursor for S1"

EXECSQL "open c1"



/* loop through result set */

records = 0

do while 1 = 1



EXECSQL "fetch from c1 into :splf_name, :job_name, :splnbr"

if SQLSTATE = '02000' then leave

if SQLSTATE <> '00000' then do

say "Abnormal SQLSTATE =" SQLSTATE

leave

end



records = records + 1

cmd =,

"dltsplf file(" || strip(splf_name) || ")",

"job(" || strip(job_name) || ")",

"splnbr(" || strip(splnbr) || ")";

say cmd;

address command cmd;



end /* repeat loop */



EXECSQL "close c1"



say records "records processed."

EXIT



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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

This mailing list archive is Copyright 1997-2026 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.