11-10-2014 05:27 PM
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?
11-10-2014 07:49 PM
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;
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?