BookmarkSubscribeRSS Feed
Calcite | Level 5

To All:

I am trying to determine how to take the lock off the SAS data set when another person is using it.  Actually I would like to know how to allow more than one person to be able to upload data to a SAS dataset at the same time?

For example when person A is working within the dataset, if person B tries to open and work within it, the data set is locked and person B cannot input his data.  Is there a way to get rid of the lock?



Rhodochrosite | Level 12

You need to use SAS/SHARE for concurrent user updates. It was developed to handle such requirements.


If SAS/SHARE is not available to you there are ways of checking locks, and then delaying updates until the other process has finished using it. This type of solution is only workable for low numbers of users and for data updates that don't last very long. If you want to explore this option, check out the dataset OPEN function, and consider how you could put this in a loop to keep trying it until it is successful.

Personally I think SAS should incorporate the SHARE capability in the BASE SAS product - I'm sure most users have struck issues like unable to open your SASUSER.PROFILE warning just because you run more than one SAS session at the same time and SASUSER cannot be shared! How about it SAS (end of rant)? 

Rhodochrosite | Level 12

A manual approach is possible but it will have its flaws and you'll have to develop a really robust application Interface to Minimize/Eliminate pitfalls.

Check the LOCK Statement in the SAS Online Help Docs, it's available part of BASE SAS & SAS/SHARE. Having said that,

even if you built some sort of Graphical User Interface, to manage your Data Set(s), there is no way you can stop users from access the Data Set(s) directly from within SAS Explorer Window, or even from the Data Step/SQL statements!!!

Hence your best bet, is to have your volatile Data Set(s) that could be modified by multiple users managed by SAS/SHARE Server/Library definition, and this way, you'll be covered all around regardless where the data get access from.

just my 2 cents,


Rhodochrosite | Level 12

another option, that I consider more robust and simpler that writing your own equivalent to SAS/SHARE - use an external database which is designed to support concurrent transaction updates  by more than one user.

Of course, you'll need a SAS/Access module to read the data ...... might be simplest just to invest in SAS/SHARE   😉

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 4 in conversation