Desktop productivity for business analysts and programmers

Deleting FILTER_FOR_ work datasets

Frequent Contributor
Posts: 75

Deleting FILTER_FOR_ work datasets


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?


Frequent Contributor
Posts: 75

Re: Deleting FILTER_FOR_ work datasets

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 '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?

Ask a Question
Discussion stats
  • 1 reply
  • 1 in conversation