我有三个变量,x,y,z。我要做的事情是,生成x_new=x*2,y_new=y*2,z_new=z*2.我使用使用如下SAS发布的macro,未作任何改动,仅仅加了一行。然后在下面的data step调试,死活报错(ERROR 180-322: Statement is not valid or it is used out of proper order.)急急急!求帮忙!在线等。
***************
这是SAS发布的MACRO: Sample 26155: Loop through a nonsequential list of values with a macro DO loop
%macro loop(values);
/* Count the number of values in the string */
%let count=%sysfunc(countw(&values));
/* Loop through the total number of values */
%do i = 1 %to &count;
%let value=%qscan(&values,&i,%str(,));
%put &value;
&value._new=&value*2;
%end;
%mend;
这是我的调试代码,会报错:(ERROR 180-322: Statement is not valid or it is used out of proper order.)
data t;
x=1;
y=2;
z=3;
%loop(%str(x,y,z)) ;
run;