写了一段宏程序,怎么调试都得不到结果,很头大,求助各位大虾。程序如下,当N=1时,sum_drugs_&y.M_sum_drugs_&x.M就变成sum_drugs_6M_sum_drugs_3M,这个变量数据库自带并且是数值型。但是每次运行的时候,就说 A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: sum_drugs_6M_sum_drugs_3M。也就是说sum_drugs_6M_sum_drugs_3M不是数值型!!不知道怎么回事啊~~
%macro drugpoint(N=);
%do i=&N %to 7;
%let x=%eval(&N*3);
%let y=%eval((&N+1)*3);
%let drugs_ab=%eval(sum_drugs_&y.M_sum_drugs_&x.M);
%if &drugs_ab=1 or &drugs_ab=-1 %then %do;
%if B_B_&x.M_c ~= B_B_&y.M_c %then IOP_B_B=IOP_&y.M-IOP_&x.M;
%else %if PGA_&x.M_c ~= PGA_&y.M_c %then IOP_PGA=IOP_&y.M-IOP_&x.M;
%else %if Miotic_&x.M_c ~= Miotic_&y.M_c %then IOP_Miotic=IOP_&y.M-IOP_&x.M;
%else %if CAI_&x.M_c ~= CAI_&y.M_c %then IOP_CAI=IOP_&y.M-IOP_&x.M;
%else %if Diamox_&x.M_c ~= Diamox_&y.M_c %then IOP_Diamox=IOP_&y.M-IOP_&x.M;
%else %if Adren_&x.M_c ~= Adren_&y.M_c %then IOP_Adren=IOP_&y.M-IOP_&x.M;
%end;
%end;
%mend drugpoint;