Hello
Is it possible to update (add rows) to a permanent data set from multiple sas sessions?
Didn't you already ask that question?
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.
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.
@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.
If you set FILELOCKWAIT = 20, then it should be more than adequate to cope with your 10 second process time.
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.
Ready to level-up your skills? Choose your own adventure.