From: "SUBSCRIBE SAS-L Joe H. Smith" on
hi all,

i have two tables i want to update master table ,i am wriing the code in proc it
gives me following error.

data test;
input a b z;
cards;
1 2 100
3 4 35
5 6 .
15 58 68
15 20 65
;

data test1;
input a b c;
cards;
1 22 1
12 4 2
115 6 3
15 20 4
;
proc sql UNDO_POLICY=NONE;
update test t1
set z=(select c from test1 as t1 ,test as t2 where t1.a=t2.a)
where (select t2.a from test1 t2 ,test t1 where t1.a=t2.a and t1.b=t2.b);
quit;

error:
WARNING: A value expression of the SET clause references the data set being
updated.
WARNING: The SQL option UNDO_POLICY=REQUIRED is not in effect. If an error
is detected when processing this UPDATE statement, that
error will not cause the entire statement to fail.
ERROR: Subquery evaluated to more than one row.


o/p i need is
a b z
1 2 100
3 4 35
5 6 .
15 58 68
15 20 4


thanks all
 | 
Pages: 1
Prev: Reshaping Data
Next: update table