How do I convert dates of this form 10/27/2006 to numeric? some dates are 2/2/2006?
If I understood it correctly, you need number equivalent to the date then please try this.
data have;
input date mmddyy10.;
format date mmddyy10.;
date_number=date;
datalines;
10/27/2006
;
If I understood it correctly, you need number equivalent to the date then please try this.
data have;
input date mmddyy10.;
format date mmddyy10.;
date_number=date;
datalines;
10/27/2006
;
I do not understand, the data is imported from excel, the variable name is date.
Just as you said I need number equivalent to the date then please try this.
What is the type of date variable? Are you looking to convert char date variable into numeric or just need to know number which represents 10/27/2006?
A number 10/27/2006
What is the desired output?
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.