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...
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Ready to level-up your skills? Choose your own adventure.