data example;
do j=1 to 33;
output;
end;
run;
proc surveyselect data=example
out=result method=srs n=5;
run;
data _null_;
set result end=last;
call symputx(cats("sur",_n_),j);
if last then call symputx("num",_n_);
run;
%macro test;
data shuju_sur;
set shuju ;
keep %do i=1 %to &num.;
q&&sur&i.
%end;;
run;
%mend;
%test;
发现你只有q1-q33的变量 不知道是不是你要的意思?