SAS Macro to Cleanup your WORK directory


/ Published in: SAS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. %macro CleanupWORK(membertype);
  2. /***
  3. ACCESS - access descriptor files (created by SAS/ACCESS software)
  4. ALL - all member types
  5. CATALOG- SAS catalogs
  6. DATA - SAS data files
  7. FDB - financial database
  8. MDDB - multidimensional database
  9. PROGRAM - stored compiled SAS programs
  10. VIEW - SAS views
  11. ****/
  12.  
  13.  
  14. %let validvals=ACCESS ALL CATALOG DATA FDB MDDB PROGRAM VIEW;
  15. %if %index(&validvals,%upcase(&membertype)) gt 0 %then
  16. %do;
  17. proc datasets lib=WORK kill nolist memtype=%upcase(&membertype);
  18. quit;
  19. %end;
  20. %mend;
  21.  
  22. /* Want to delete all Work Datasets*/
  23. %CleanupWORK(data);
  24. %CleanupWORK(CATALOG);

URL: http://sastechies.blogspot.com/2009/12/sas-macro-to-clean-up-work-directory.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.