sas proc sql assign value to macro variable
Calculate a value and assign it to a macro variable with
sas proc sql
proc sql noprint;
select ssn format=9. into :ssnok
separated by ' ' from ssn_list;
quit;
%put &ssnok;
123456789 234567890 345678901 456789012
[CREATING MACRO VARIABLES VIA PROC SQL PDF]