So, I have a column for just years but its showing as a numeric value in sas.
How do I convert it to years in sas studio.
What I tried
- I tried the ttransforming the data but I keep running to an error because I dont know the exact Format
I want it to be a date
Alright, thanks.
can you give me like a sample code idea for it. I will work out the rest...
data have;
input Time;
datalines;
2011
2010
2004
;
run;/* Create a new variable with January 1st of each year */
data want;
set have;
/* using MDY function with January 1st */
new_date = mdy(1, 1, year);
format new_date year4.; /* Format the date to display only the year */
run;
Tried this, it didnt work...
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Select SAS Training centers are offering in-person courses. View upcoming courses for: