BookmarkSubscribeRSS Feed
JohnT
Quartz | Level 8

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.

1 REPLY 1
JohnT
Quartz | Level 8

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?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1216 views
  • 3 likes
  • 1 in conversation