Hi all,
I have a set of data with customer name, birth_date. I need to create a few new variables, Bday2009, BdayDOW2009 and Age2009.
How shall I write the codes?
Pardon as I am new to SAS and this is my school assignment which am now having diffculities in solving. Thanks advance for any help given.
Show us examples of what you have tried.
Hi,
the Birth_date is in date9, format (example; 12July1974),
i am stacked at creating the Bday2009 variables as I need to combine the day and month of birth_date with a constant year of 2009,
i tried:
Birth_date=myd(month,3, day,2, year,4);
year= ‘2009’;
Bday2009=day month year;
run;
Tried several ways but still can’t get it...
bday2009=mdy(month(birth_date),day(birth_date),2009);
Ok, will try it. Thanks for the help.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.