Dear All,
I would like to write a SAS program to get the current date and determine number of days in the month prior to current month.
Find difference in days, months, and years between. Is it possible using SAS ?
Thanks a lot for help.
Regards,
S Ravuri.
Keith,
Code worked Well. Thanks a lot and appreciate for your great help.
Regards,
S Ravuri.
This looks a very similar question to one I answered earlier today. Check out my reply and the link I included, they should give you some ideas on how to do this.
Thanks Keith for the reply.
Am getting the values for difference in days, months, and years in between.
Can you please help me how can we get the no.of days for prior month to the current month.
Thanks a lot in advance for help.
Regards,
S Ravuri.
Just use the INTNX function as below. This will subtract the 1st of the previous month from the 1st of the current month.
data num_days;
a=today();
prev_month=intnx('month',a,0)-intnx('month',a,-1);
run;
Keith,
Code worked Well. Thanks a lot and appreciate for your great help.
Regards,
S Ravuri.
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.