How can I update a field in one table with data from another table. (In access, an "update" query)
I have tried to join the tables and then update the field that I need, but I keep getting errors!!!!!!!!
mbliss,
If the updating field is also residing in a separate SAS DATASET then you would merge two dataset, dropping the original value and retaining new one.
/**dataset to be updated
drop the original field1 sort by the merge field here it is "key"**/
proc sort data=dsn.data1 out=data1(drop=field1);
by key;
run;
/***dataset that has new values that would be used to do update**/
proc sort data=dsn.data2 out=data2(keep=key field1);
by key;
run;
data new;
merge
data1(in=in1)
data2(in=in2)
; by key;
if in1 and in2;/**this is an inner join**/
run;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.