I have scheduled code that makes the same table each night, which is shared. Some people accidentally leave the table open - then it does not update.
Is there a way in the code to close the table in someone else's session?
Thanks!
No.
But you can use operating system commands to delete the file. At least in UNIX it is possible to remove a directory entry although the file is open.
@Jpep wrote:
That would work since I am replacing the table anyway. We have tried proc delete commands and it does not work since it is someone else's session.
What operating system commands should we attempt?
Thank you!
This depends on the operating system that SAS is installed on. If it is UNIX, I can provide a macro that physically deletes a dataset no matter what.
The issue of sharing/opening SAS datasets while trying to also update them has been the subject of innumerable discussions over the years...
The bottom line is there is no easy answer but here are a few ways to deal with this:
Thanks @LinusH. I've never used SAS/SHARE but I think depending on the update method being used this could work judging by what I see in this link (assuming of course that all users access the multi-user table via a SAS/SHARE server):
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.