%macro cluster(x1,x2,i);
%do j=1 %to &i;
%if z1>=%sysevalf(&x1/(2*&j))& z2>=%sysevalf(&x2/(2*&j)) %then cluster=(3*&j-2);
%else %if 0=<z1<%sysevalf(&x1/(2*&j))& z2>=%sysevalf(&x2/(2*&j)) %then cluster=3*&j-1;
%else %if z1>=%sysevalf(&x1/(2*&j))& z2<%sysevalf(&x2/(2*&j)) %then cluster=3*&);
%else %if 0=<z1<%sysevalf(&x1/(2*&j))& 0=<z2<%sysevalf(&x2/(2*&j)) %then cluster=3*&j+1;
%end;
%mend;
data m.result;
set m.result;
%cluster(6.294,4.815,3);
run;
Z1和Z2是result的两个变量我想按照这两个变量的值分类,然后构造一个cluster变量放类别名称。总是说我这个出错,弄了一个下午了,大家帮帮忙
cluster=(3*&j-2)
----
22
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, ;, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT, LE, LT, MAX, MIN, NE, NG, NL,OR,^=, |, ||, ~=.