data a;
input tstart date10. tend date10. huoqi;
datalines;
10JUN1999 21FEB2002 1
21FEB2002 29OCT2004 2
29OCT2004 19AUG2006 4
;
run; /*建立数据集a*/
data ding200(keep=x y z );
x=100000;
a='23feb2000'd;
b='23mar2000'd;
d1=12*yrdif(a,b,'act/act'); /*a,b实际相差的月数*/
d2=datdif(a,b,'act/act'); /*a,b实际相差的天数*/
set a;
%macro tiqian(x1);
%if x=&x1 %then %do;
if tstart< b <=tend then do;
y=x*d5*huoqi/360/100;z=x+y;output;end;
%end;
%else %if &x1<x %then %do;
if tstart< b <=tend then do;
y=%eval(&x1*d2*huoqi/360/100);
z=x+y;
if tstart< a<=tend then do;
y=%eval(x-&x1*d1*huoqi/12/100); /*我想弄出x1的值进行运算*/
z=z+y;output;end;
end;
%end;
%mend tiqian;
%tiqian(100000);
run;
我在上面建立一个关于x1的宏参数,上面标红的应该就是我出错的地方,只是不知道怎么改才是正确的。希望大家帮帮忙呀!!!