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.
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.