BookmarkSubscribeRSS Feed
Ronein
Onyx | Level 15

Hello

Is it possible to update (add rows) to a permanent data set from multiple sas sessions?

 

8 REPLIES 8
Ronein
Onyx | Level 15
No.
In previous question I asked if possible to use same data set source in different sessions but in each session update another data set that us different between sessions.
In this question I asked if can update same data set in multiple sessions
ballardw
Super User

By  "multiple sessions" do you mean concurrently? As in multiple SAS jobs running at the same time, possibly by different users.  That is likely to be a bit tricky as you have a possibility of attempting multiple access at same time.

 

If by "multiple sessions" you mean on different days then proc append would work just fine. Unless you have the same problems with changing variable types/names as your other posts.

Ronein
Onyx | Level 15
Thanks
I mean run same program in same time ( by me or also by others and this program update( add rows) to same permanent sas data set
Quentin
Super User

If multiple SAS sessions try to update a SAS dataset at the same time, you will run into the file locking issues discussed in the other thread.  It doesn't matter if the the program is the same, or if the two users are the same.  When one process begins writing to the file, it will lock the file.  If another process tries to write to the file at the same time, it will error because the file is locked.

The Boston Area SAS Users Group is hosting free webinars!
Next up: Lisa Mendez & Richann Watson present Get Tipsy with Debugging Tips for SAS® Code: The After Party on Wednesday Jul 16.
Register now at https://www.basug.org/events.
Tom
Super User Tom
Super User

@Ronein wrote:
No.
In previous question I asked if possible to use same data set source in different sessions but in each session update another data set that us different between sessions.
In this question I asked if can update same data set in multiple sessions

Well if that is what you meant in the other session then there wasn't really an issue in that scenario.  Multiple sessions reading the same file is not an issue.  It is only when multiple sessions are trying to write to the same file that you will have conflicts.  The answer marked on the other thread is the answer to this thread.  That is either use something like an external database (Postgres, Oracle, etc) or SAS/Share that is designed to handle multiple updates.  Or try to manage the risk of conflict by keeping the update process fast and setting the lock wait time longer than the time it takes to update.

 

Ronein
Onyx | Level 15
When sas update the date set in one process then it lock it only during the update time ( which can take 10 seconds via proc append)...
SASKiwi
PROC Star

If you set FILELOCKWAIT = 20, then it should be more than adequate to cope with your 10 second process time.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 8 replies
  • 855 views
  • 1 like
  • 5 in conversation