情迷仲夏夜 发表于 2011-12-22 05:49 
7楼的程序可以工作呀!
%macro create_dumy;
data b;
为啥 我的不能工作呢?童鞋,帮忙看下把。这是我的log值。
32 %macro create_dumy;
33 data b;
34 set a;
35 %do i=1 %to &n.;dumy_&i=0;%end;
36 select(sic);
37 %do i=1 %to &n.;
38 %let val = %scan(&values.,&i);
39 when( "&val.") dumy_&i =1;
40 %end;
41 otherwise put '0';end;
42 proc print data=b;run;
43 %mend;
44 %create_dumy
WARNING: Apparent symbolic reference N not resolved.
ERROR: A character operand was found in the %EVAL function or %IF condition where a
numeric operand is required. The condition was: &n.
ERROR: The %TO value of the %DO I loop is invalid.
ERROR: The macro CREATE_DUMY will stop executing.