Me thinks everyone is over thinking this...take a look at the printfile
parms EXPDATE and DAYS . The default is *NONE ( next to last page of the
parms ). Change the printfile to 60 and *DAYS. Now you can use the
DLTEXPSPLF cmd

Kirk


On Fri, May 10, 2013 at 4:27 PM, CRPence <CRPbottle@xxxxxxxxx> wrote:

On 10 May 2013 12:15, Vidal, Peter wrote:
On 10 May 2013 11:27, John Mathew wrote:

I want to do something creative to my project or automation.

For example: Deleting a spool files which are older than 30 days.

I agree that you can search on GOOGLE and you could get some free
ideas about how to do this. You may use APIs or other little tricks
like:

a) WRKSPLF SELECT(*CURRENT) OUTPUT(*PRINT)
b) CPYSPLF FILE(QPRTSPLF) TOFILE(MYLIBRARY/MYFILE)
JOB(JOBNO/JOBUSRID/JOBNAME)
c) With a program you can read the spooled file created on step "a".
d) The report has spooled file name, job name, job user id, file
number and job number, as well as the creation date and time.
So, you can
1) Calculate - in the program - what is 30 days in the past and
based on that
2) Call a 2nd program and send the required parameters - maybe use
the DLTSPLF command (DLTSPLF FILE(SPOOLFILE) JOB(JOBNO/JOBUSRID/JOBNAME)
SPLNBR(FILENO))
e) You can run the program on step "c" until EOF is reached.

Some coding is required but I do not believe is impossible. However,
if I can "invoke the *SPENDMONEY command" it will be awesome to have
the TAATOOLS in your shop.

Just a suggestion.

If one were really so averse to using the APIs that are provided, and
also were content with such /tricks/ both being easily impacted by OS
reporting [printer file] changes and possibly functional only on the
installed language and release on which the code was first written, then
why not just write the output of the WRKSPLF directly into a database
file over which a SQL query is run to effect the command invocation?
e.g. the following work gets the data into a database file and the SQL
can be used to issue any ad-hoc requests beyond just the DLTSPLF, by
dynamically building the command request from the column data:

clrpfm qtemp/qprtspld
; -- presumes prior effective CRTPF QTEMP/QPRTSPLD
ovrdbf qprtsplf qtemp/qprtsplf lvlchk(*no)
; -- presumes prior CRTLF QTEMP/QPRTSPLF over QPRTSPLD
wrksplf *all output(*print)
;
/* run in same SQL OPTION DATFMT as job DATFMT() */
select cmdExec( 'dltsplf ' concat file concat ' job('
concat jobnbr concat '/' concat rtrim(jobuser)
concat '/' concat jobname concat ')'
concat ' splnbr(' concat filenbr concat ')' )
from qtemp/qprtspldta /* pf under LF qprtsplf */
where days(current date) - days( nullif(crtdate, '') ) > 30
; -- presumes UDF cmdExec exists for the purpose of QCMDEXC
dltovr qprtsplf
;

--
Regards, Chuck
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.