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;
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.