04-11-2016 01:46 AM
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?
04-11-2016 02:05 AM
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.
04-11-2016 03:32 AM
A variation of @KurtBremser's method 1 is to stop and re-start the SAS workspace server services before running any update jobs. This will drop all SAS sessions including any locks they have on SAS datasets.
04-11-2016 09:24 AM
@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.
04-11-2016 03:51 PM
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.
04-11-2016 04:25 PM
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.
04-11-2016 04:25 PM
04-12-2016 03:32 PM
@LinusH - I think you are correct however I should have explained that shutting down metadata server services will do the trick.
04-27-2016 01:45 PM
How about to use PROC IOMOPERATE to list and stop your SAS sessions avoidind the jobs to fail the execution.
Here some useful links: