开发者

week function in proc sql

does any one know how to get weeknumber within sas proc 开发者_如何学Gosql ?


Personally, I find it very hard to go past SAS's own, native WEEK function. It can be called from inside proc sql. Pass it a date value and it will give you the week number.


Found this at the following link: http://www.hollandnumerics.co.uk/sasfaq/SASFAQ1.HTM

You can simulate a WEEK function by using the SAS functions INTCK and INTNX, e.g.:

DATA getweek;
   datevar=TODAY();
   week=INTCK('WEEK',
         INTNX('YEAR',datevar,0),
         datevar)+1;
RUN;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜