Gday,
We are running Enterprise Guide 5.1 on a Windows based server.
I have some users that like to the the Filter and Sort task. I absolutely hate this as it puts locks on datasets (whilst typing this, it occurred to me that I could disable access to the Filter and Sort task, but I don't really want to do that), so when my daily jobs run, if there is a lock on one of the early datasets, everything fails, and I have to run everything during the workday.
Is there a way to delete the datasets that typically start with FILTER_FOR_ (whatever the table was called) at the end of each day?
Is it possible in SAS?
I wouldn't want it just doing the deletion for my account, but every user that has a session open overnight.
Two approaches pop into my mind:
* Run a script that crawls through all the work directories and looks for any file that starts with FILTER_FOR and deletes them (my dos/shell scripting is very basic at best)
* Schedule a query each night in SAS that deletes these files, PROC DELETE/DATASET for example (I wouldn't know how to have this run against all WORK directories though)
Does anyone have any other suggestions, or has something like this implemented?
Thanks.
I thought about using the dictionary views/tables in the SASHELP library. I wasn't able to find WORK sessions for other users, just my current session.
I tried a script, and I think it works. I have it scheduled to run at 9pm every night. This is what I ended up with:
*delete filter_for_ datasets that can cause locks on data;
*from;
*http://techie-buzz.com/tips-and-tricks/recursively-delete-files-in-folders-and-sub-folders-using-com...
x 'w:';
x 'cd W:\SASWORK\temp';
x 'del /s filter_for_*.sas7bdat';
Pretty simple solution in the end I think, not particularly elegant, but it gets the job done.
I'm still interested if there is a better solution to this though?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.