开发者

week function in proc sql

开发者 https://www.devze.com 2023-02-19 03:04 出处:网络
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

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

精彩评论

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