Hi
I'm also looking into this at the moment. I am working with date and time stamps, and want to round down to the nearest minute - this means I would like round down a number to the nearest increment of 60.
Currently I am using round(floor(timepart(a.update_dt)/60)*60, 1) .
Does anyone have a difference/better solution?
Using the intnx-function seems to be better:
data _null_;
d = datetime();
put d datetime.;
r = intnx('dtminutes', d, 0, 'B');
put r datetime.;
run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.