Hi!
I need to get the last day of the month using the basedate.
I tried with the intnx('month',basedate,i, 'same'). If the basedate=30Apr2014 then the next month is 30May2014, but I need it to be 31May2014.
I appreciate if you can help me with it.
Thanks and kind regards,
Paula
RTM
for the aligment use END rather than SAME:
SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition
'alignment'
controls the position of SAS dates within the interval. You must enclose alignment in quotation marks. Alignment can be one of these values:
specifies that the returned date or datetime value is aligned to the beginning of the interval.
Alias: | B |
specifies that the returned date or datetime value is aligned to the midpoint of the interval, which is the average of the beginning and ending alignment values.
Alias: | M |
specifies that the returned date or datetime value is aligned to the end of the interval.
Alias: | E |
specifies that the date that is returned has the same alignment as the input date.
Alias: | S |
Alias: | SAMEDAY |
See: | SAME Alignment for more information. |
Thank you very much!
Is working now. Thanks!
%let nextmonthend =%sysfunc( intnx( month, "&sysdate9"d, 1, e), date9 ) ;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.