× 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.



Hi Thomas,

I use the QUSLSPL api to get that information.
Which also means you will need to use APIs to get at the data returned from
QUSLSPL as it will be in a User Space.

I wrote a command for deleting spooled files.
I pass in:

USER: (defaults to my profile)
QUALIFIED OUTQ: (defaults to *ALL)
OPTION: ( I default this to *PARTIAL but it can be set to *ALL)

The OPTION parameter is my way of specifying if I want to keep any of the
spooled files.

My simple solution was that if I want to keep any spooled files then I
change Pos 1 of the USRDTA to "@"
This is a manual step I take for any spool I want to keep - using opt 2
from the Spool to run CHGSPLFA

Using the QUSLSPL API is a bit annoying but it's not that bad.
You have to specify different keys for the different attributes you want
back - I believe I used:

Dcl-Ds Keys Qualified;
SplFileName Int( 10 ) Inz( 201 );
JobName Int( 10 ) Inz( 202 );
UserName Int( 10 ) Inz( 203 );
JobNbr Int( 10 ) Inz( 204 );
SplFileNbr Int( 10 ) Inz( 205 );
UsrDta Int( 10 ) Inz( 209 );
End-Ds;

Each entry returned, tells you how big it is and the API Header information
in the User Space tells you where the list info starts, so you can
basically find the first list item and then you have to use it's length to
tell you where the next item in the User Space is.

If you've done things with APIs and User Spaces before, it's pretty
straightforward.
If you have not, it might be a little painful.

You call QUSLSPL api to get a list of the spooled files (in my case it's
usually for my user profile and *ALL OUTQs with my special '*PARTIAL'
option)
You read the data returned in the User Space to get all the spooled files
and their attributes

My last step was to say - if the Option parm was passed as *ALL, or the
UserData does not begin with '@' then delete the spooled file

I deleted the spooled file via QCMDEXC - you'll need to specify:
SpoolFile (Name and Number)
Job(Name, User, Nbr)

I hope this helps,
regards,
Craig


On Tue, 19 Mar 2019 at 21:49, Thomas Burrows <thomas.burrows.1957@xxxxxxxxx>
wrote:

When doing a DLTSPLF I cannot figure out a way to input the changing USER
DATA or JOB from the spool file information. I can give my six character
number a starting point and then increment. With a stopping point.

But how would I delete a mass of say joblogs that being dumped into a spool
file everyday to hold down on system space.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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.