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.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 252 views
  • 0 likes
  • 2 in conversation