since there are only two variables in table B. you merge table A and B together. It is very easy.
data C;
merge A B(rename=(x=xb y=yb));
xx = (x-bx)^2;
yy = (y-by)^2;
run;
If your case is more complicated, send me the detail. I hope this will be helpful.