I have a date of birth variable (brthdtc) saved as text with data captured as 1947/02 (yyyy/mm) and I want to convert it to numeric date as 1947-02-15 (use 15 as convention), does anyone know how to do this?
data have;
char_Date='1947/02';
run;
data want;
set have;
num_date=input(compress(char_Date,'/'),yymmn6.)+14;
format num_date yymmdd10.;
run;
data have;
char_Date='1947/02';
run;
data want;
set have;
num_date=input(compress(char_Date,'/'),yymmn6.)+14;
format num_date yymmdd10.;
run;
@novinosrin THANK YOU!!!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.