akalius 发表于 2014-8-8 15:35 
您好,不好意思,在这个问题的基础上再请教一下,如果此时增加了i j k,三个变量 ,在每个数据集中仍然只是 ...
Here it is.
data _null_;
file 'c:\temp\11s6.sas';
array x(11) $1 ('a' 'b' 'c' 'd' 'e' 'f' 'g' 'h', 'i','j','k');
k=6;
n=dim(x);
nsets=comb(n, k);
do j=1 to nsets;
call allcomb(j, k, of x(*));
put 'temp' j '(keep=' x1-x6 ')';
end;
run;
data %include 'c:\temp\11s6.sas';
;
set a;
run;