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'/'yyyy .
   if datatype(mm) /= 'NUM' then iterate
   if hold /= 'NONE' then iterate
   mm=space(mm)
   mm=right(mm,2,'0')
   dat = yyyy||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.com>                                                    To 
             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

Reply via email to