I'm trying to increment a date time that is formatted 19FEB2019:00:00:00.000, using the intnx function by 10 days, but
Using this code:
INTNX('dtday', t1.CLCL_RECD_DT,10)
is returning 1867017600
and i'm not entirely sure what to do with that, is that 10 days after in seconds? Can I convert it?
You can apply format=datetime20. to your result.
Yes it is 10 days after in seconds
you could use a datepart function if you want to extract date value from datetime value. Not sure what you want to do though
You can apply format=datetime20. to your result.
Yes it is 10 days after in seconds
you could use a datepart function if you want to extract date value from datetime value. Not sure what you want to do though
That is what you asked for. Attach a datetime format, like DATETIME19., to the variable and it will be displayed in a more human readable way.
108 data _null_; 109 old='19FEB2019:00:00:00.000'dt; 110 new=intnx('dtday',old,10); 111 put old= old comma19. old datetime19.; 112 put new= new comma19. new datetime19.; 113 run; old=1866153600 1,866,153,600 19FEB2019:00:00:00 new=1867017600 1,867,017,600 01MAR2019:00:00:00
@Schmageggy wrote:
both of these solutions are very helpful and I appreciate, really the first
one is all I needed to use in a between filter. thank you though will use
it for the output
Right. There is no need to attach the format to use the value in code. The formats just make the values easier for humans to read.
1867017600 and '01MAR2019:00:00:00'dt represent the same underlying numeric value.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.