|
SAS Help:
For all multiunit intervals except multiweek intervals, the SAS System creates an interval beginning on January 1, 1960, and counts forward from that date to determine where individual intervals begin on the calendar. As a practical matter, when a year can be divided evenly by an interval, think of the intervals as beginning with the current year.
下面的代码可以输出每个 'day365' 区间的第一天。
data test;
from='01jan1960'd;
format beginner yymmdd10. ;
do i=0 to 51;
beginner=intnx('day365',from,i);
put beginner= ;
output;
end;
run;
part of log:
beginner=2007-12-20
beginner=2008-12-19
beginner=2009-12-19
beginner=2010-12-19
mob=intck('day365','18dec2009'd,'10oct2010'd);
mob1=intck('day365','19dec2009'd,'10oct2010'd);
'18dec2009'd 和 '10oct2010'd 之间包含了一个beginner "2009-12-19",所以mob值是1,
'19dec2009'd 和 '10oct2010'd 之间不包含beginner,所以mob1的值是0。
希望对你有点帮助。
|