I am using SAS 9.4 in a client server model.
The sas jobs execute on Unix server. There can be many users who can open a dataset for viewing.
Now, when some one opens it for even viewing , and forgets to close it, my job fails when it tries to update those datasets.
Is there any way we can force to update those datasets without the jobs failing ?
Also is there any way if we can know if a dataset is open on someone's workstation?
Method 1: Declare a time window for updating datasets and suspend workspace server operations during that time window.
Method 2: Use a trick that I do; I obtain the physical dataset filename from the library definition and the dataset name, and use one of the methods for system commands (X statement, call system() subroutine, %sysexec, filename pipe) to do a "rm -f filename". This works even when someone accesses the dataset. All users who have the dataset open will see the old version until they close and reopen.
@SASKiwi - you mean "SAS workspace server sessions" I guess...?
If you have lots of data, and import updates etc (like en enterprise wide DW) you should consider another storage format that handles concurrent read/update operations. In SAS, SPD Server offers that. And most external RDBMS does as well.
Actually @LinusH I was thinking of the Windows services that run to support a SAS Compute server. Stopping and restarting these drops all user sessions. I guess there is an equivalent under Unix but I'm not so familiar with that as I don't use it currently.
On UNIX systems, terminating the spawner will not affect client sessions. But one could write a script that finds all workspace server sessions through the peculiarities of their command line, and terminates them.
I prefer my method of deleting the files, as it is less "destructive" for users.
How about to use PROC IOMOPERATE to list and stop your SAS sessions avoidind the jobs to fail the execution.
Here some useful links:
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.