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!!!
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.