BookmarkSubscribeRSS Feed
subhani4
Obsidian | Level 7

Hi everyone,

 

i have below code. where i am performing append and insert on a dataset cls. the program ends with error table damage. Could any one advise how to achieve multiple operation on a common dataset at a sametime with multiple users/jobs. Thanks in advance!!

 

code:

user1 submit :

libname abc  "c:\temp" ;

 

data abc.cls;
set sashelp.class;
run;


options mprint mlogic symbolgen;
%macro loop;
%do i=1 %to 1000;
proc append base=abc.cls data=sashelp.class force;
run;
%end;
%mend;
%loop;

 

user2 submit:

libname abc2 "c:\temp";   

%macro loop;
%do i=1 %to 1000;          
proc sql noprint;
insert into abc2.cls set name="subbu",sex='M',age=29 ,weight=. , height=.;
quit;

%end;
%mend;
%loop;

 

1 REPLY 1
SASKiwi
PROC Star

SAS datasets are not designed to be updated simultaneously by different users using the default SAS library engine. You could try the the FILELOCKWAIT option on your LIBNAME statement to see if that helps. As long as each update is quick then you may find this option works reliably. If not then a couple of other options are to use SAS/SHARE (available as a separate product) or to load the dataset into a relational database which will handle the multi-user updating automatically.

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 1 reply
  • 601 views
  • 0 likes
  • 2 in conversation