SAS中文论坛

标题: anyone can help for a SAS macro code [打印本页]

作者: shiyiming    时间: 2013-9-19 06:20
标题: anyone can help for a SAS macro code
%macro ad(to_dt=);
/* %let from_dt1=%sysfunc(intnx(year,"&to_dt."d,-3,sameday));*/
data a;
  from_dt1=intnx('year',"&to_dt."d,-3,'sameday');
  format from_dt1 date9.;
  call symput('from_dt2',from_dt1);
run;
%put  from_dt2=&from_dt2.;
%mend;
%ad(to_dt=31aug2013)

the code above just want to create a new macro variable'from_dt2' which value is the 3 years prior of 'to_dt', but failed, either just give me the number (i.e. 13850) not 31aug2010 format, or it did not work at all.
I want to get from_dt=31aug2010 if to_dt=31aug2013, note: not the number, have to be the date9. format.

thx!!!
作者: shiyiming    时间: 2013-9-19 23:53
标题: Re: anyone can help for a SAS macro code
fixed.




欢迎光临 SAS中文论坛 (http://mysas.net/forum/) Powered by Discuz! X3.2