写了一个宏。希望可以将一个用空格分开的字符串(例如“x1 x2 x6”)中的各个子字符串提取出来,并批量赋值给新变量。
结果运行的时候报错,说I 不能被解析。哪位帮忙看下什么地方出错了?
%macro test(varlist);
data test;
x=&varlist;
count1=count(x,' ');
do i=1 to count1;
x&i=scan(x,i,' ');
output;
i+1;
end;
run;
%mend;
%test('x1 x2 x6');
WARNING: 没有解析符号引用 I。