c**********5 发帖数: 653 | 1 Here is my sas code;
%macro va_111(field1,field2,new_var);
Data c;
merge mydata1 (in=a) mydata2;
by id;
if a;
%if &filed1=2 %then &new_var=0;
%else %if &filed2=" " and &filed1 =. %then &new_var=0;
%else &new_var=1;
run;
%mend;
%va_111(usuage,drugname,status);
Sas log:
WARNING: Apparent symbolic reference FILED1 not resolved.
ERROR: A character operand was found in the %EVAL function or %IF condition
where a numeric operand
is required. The condition was: (&filed1)=2
ERROR: The macr | d********h 发帖数: 2048 | 2 检查你的变量拼写, filed or field | c**********5 发帖数: 653 | 3 OH ,i AM STUPID .Thanks
【在 c**********5 的大作中提到】 : Here is my sas code; : %macro va_111(field1,field2,new_var); : Data c; : merge mydata1 (in=a) mydata2; : by id; : if a; : %if &filed1=2 %then &new_var=0; : %else %if &filed2=" " and &filed1 =. %then &new_var=0; : %else &new_var=1; : run;
|
|