BookmarkSubscribeRSS Feed
Reggie_SAS
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?

Thanks,

Reggie

4 REPLIES 4
AhmedAl_Attar
Ammonite | Level 13

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

SASKiwi
PROC Star

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)? 

AhmedAl_Attar
Ammonite | Level 13

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,

Ahmed

Peter_C
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   😉

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1128 views
  • 0 likes
  • 4 in conversation