CLNSPL - cleanup old spools

page d'accueil
Boite à outils

Cette page a été mise à jour le14 septembre 2009.
Contact

Welcome page
Tools box

Target :

delete old spool files depending on their age

Characteristics :

RPG, User space and pointers : the shortest code I've do to explore a list of spools

Sample :

 Cleanup old spools (CLNSPL) 

Type choices, press Enter.

standard spools life span . . . 7 1-99, *NOMAX
Saved spools life span . . . . . 21 1-99, *NOMAX
standard joblog life span . . . 2 1-99, *NOMAX
Saved joblog life span . . . . . *NOMAX 1-99, *NOMAX












Bottom
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
F24=More keys


Yet an other spool cleaner.

I made this tool a day I was on a site without internet access. (yes, it's already possible today). Not possible to get a free existing tool on the web.
Because I was in position to write again a spool-list-reader, I decide to make it a little spicy.

I've try to answer this question : what is the lesser number of RPG calculation statement required to walk a spool-file-list ?

The answer is 4 :

the first is the API to get the list


// get list of spools 
quslspl(usrspc// user_space
: 'SPLF0300' // Format
: '*ALL' // UserName
: '*ALL' // OutqName
: '*ALL' // FormType
: '*ALL' // UserData
: errcode );

the second if the API to get a pointer on the list (LAH mean List-Api handler)

// use LAH as a mask to format & read the user space 

qusptrus(usrspc : pLAH);

the third is a FOR to loop the list :

for iSpl= 0 to lah.count - 1; 

the forth is to get the data from one entry of the list :

// get data to load element 

psplf0300 = pLAH + LAH.Data_Offset + iSpl * LAH.entry_Size ;

last version : The SaveFiles