Re: Looking for an EXEC to Automate the cleanup of old RDR,PRT and PUN files.... x days...
On Nov 30, 2007 4:29 AM, Hamilton, Brian [EMAIL PROTECTED] wrote: I would like the exec to purge files x days and to have the capability to omit certain userids…. As far as I know, SFPURGER comes with the system. The configuration file allows you to specify all kind of criteria to decide what to do with spool files. If you have very simple requirements, a simple pipeline running once a day (via PROP for example) might also do fine. Rob --
Re: Looking for an EXEC to Automate the cleanup of old RDR,PRT and PUN files.... x days...
Here is an example of one I use. Purging RDR,PRT and PUN after x days. /**/ cur = DATE('B') call doit 'RDR 7' call doit 'PRT 14' call doit 'PUN 14' cp spool con close dist cleanspl exit doit: arg spt dys desbuf 'pipe cp q' spt 'all full | drop 1 | stack' do queued() parse pull user spid . . . . hold mm'/'dd'/' . if datatype(mm) /= 'NUM' then iterate if hold /= 'NONE' then iterate mm=space(mm) mm=right(mm,2,'0') dat = ||mm||dd dif = cur - date('B',dat,'S') if dif dys then do 'pipe cp q' spt user spid 'all | drop 1 | var spe' 'pipe cp pur' user spt spid say spe say user spt 'file' spid 'is' dif 'days old...purged' end end return John Hanley (804) 786-7823 Hamilton, Brian [EMAIL PROTECTED] gi.comTo Sent by: The IBM IBMVM@LISTSERV.UARK.EDU z/VM Operating cc System [EMAIL PROTECTED] Subject ARK.EDU Looking for an EXEC to Automate the cleanup of old RDR,PRT and PUN files x days... 11/29/2007 10:29 PM Please respond to The IBM z/VM Operating System [EMAIL PROTECTED] ARK.EDU I would like the exec to purge files x days and to have the capability to omit certain userids…. Thanks
Re: Looking for an EXEC to Automate the cleanup of old RDR,PRT and PUN files.... x days...
Well-stated need! Look up SFPURGER. It's already on your system. Mike Walter Hewitt Associates - Original Message - From: Hamilton, Brian [EMAIL PROTECTED] Sent: 11/29/2007 09:29 PM To: IBMVM@LISTSERV.UARK.EDU Subject: Looking for an EXEC to Automate the cleanup of old RDR,PRT and PUN files x days... I would like the exec to purge files x days and to have the capability to omit certain userids Thanks The information contained in this e-mail and any accompanying documents may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited. All messages sent to and from this e-mail address may be monitored as permitted by applicable law and regulations to ensure compliance with our internal policies and to protect our business. Emails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. You are deemed to have accepted these risks if you communicate with us by email.
Re: Looking for an EXEC to Automate the cleanup of old RDR,PRT and PUN files.... x days...
Hello Brian, First of all you could have a look at SFPURGER. It's located on the MAINT 193 disk. Have a look at the CMS Commands and utilities reference, Chapte r 3.8. On a few systems we do not use SFPURGER so we are running an exec there. Or rather, just a pipe statement. 'PIPE (END ?) CP Q RDR ALL ISO DIST', '| drop 1 ', '| specs /RDR/ 1 1-* nw', '| a: faninany', '| nlocate w9 /OPEN-/', '| c: locate w13 /DVH/', '| b: faninany', '| specs /PURGE/ 1 w2 nw w1 nw w3 nw', '| CP', '| count lines', '| specs /SBM_CLSP:/ 1 1-* nw /Files deleted from spooling./ nw', '| logfile log a, '? CP Q PRT ALL ISO DIST', '| drop 1 ', '| specs /PRT/ 1 1-* nw', '| a:', '? CP Q PUN ALL ISO DIST', '| drop 1 ', '| specs /PUN/ 1 1-* nw', '| a:', '? c:', '| d: locate 5.8 /SBM /', '|locate w5 /CON/', '| sort 44.17 D', '| drop 14', '| b:', '? d:', '| e: locate 5.8 /OPERATOR/', '|locate w5 /CON/', '| sort 44.17 D', '| drop 14', '| b:', '? e:', etc..., you get the idea. Basically, list all spoolfiles (RDR, PRT, PUN) and select all files you want to delete. At the end we specify users and select how many of the files are to be kept. You can code some kind of selection inside the locate/sort/drop sequence. I did not have the time yet to make something fancy to replace sfpurger functions. (Like a real select based on date or some config file like SFPURGER has). As for SBM or OPERATOR we want to keep 2 weeks of consolelogs. The consolelog is closed daily at 00:00 for these users. Regards, Berry.