INTNX(custom-interval, start-from, increment <, ‘alignment’> )
start-from:开始的日期
increment:多少个间隔
custom-interval:可以是‘day’、‘month’、‘year’等
alighment:可以是:‘beginning’期初;‘middle’期中;‘end’期末;‘same’相同时间点,都可以分别用首字母b、m、e、s代替
** 总的来说,即为经过increment个interval间隔后的sas日期 **
举例:
data t;
today='10JAN1999'd;
a=intnx('month',today,0,'end');
aBegin=intnx('month',today,0,'b');
b=intnx('month',today,1,'end');
bMiddle=intnx('month',today,1,'m');
c=intnx('month',today,-1,'end');
cSame=intnx('month',today,-1,'same');
format today a aBegin b bMiddle c cSame date10.;
run;
proc print data=t noobs;run;
结果: