Use of CALL SYMPUT
CALL SYMPUT puts the value from a dataset into a macro variable.
proc means data=test;
var x;
output out=testmean mean=xbar;
run;
data _null_;
set testmean;
call symput("xbarmac",xbar);
%put mean of x is &xbarmac;