如下宏中,为什么%if &file=='sDET'成立却不执行THEN后面的,反而跳到去执行ELSE后面的语句,程序也没有错误,求大神指点!!!!!!
还没有解决,继续等待大神的帮助!!!!
libname DET_DATA 'C:\SAS DATA\lib\det';
option mprint;
%macro downdata(file,start,end,pro);/*mcw=,ow=,ser=)*/
proc sql;
connect to odbc (datasrc=qedb user=xxxx password=1234);
%if &file=='sDET' %then create table DET_DATA.&pro as select *
from connection to odbc(select * from DBUSER.DATA_GTSD_&pro
where TST_DATE_TIME >=timestamp(current date -&end days,'00.00.00') and TST_DATE_TIME <=timestamp(current date -&start days,'24.00.00'));
%else create table DET_DATA.&pro as select *
from connection to odbc(select * from DBUSER.DATA_GTMG_&pro
where TST_DATE_TIME >=timestamp(current date -&end days,'00.00.00') and TST_DATE_TIME <=timestamp(current date -&start days,'24.00.00'));;
disconnect from odbc;
quit;
%mend;
%downdata(sDET,0,2,KCG)