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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.