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.
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!
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.