Hi Reeza,
Thanks for your comment. I will create a new post if i can't figure it out myself in the next hour or so.
As per your inquiries,
"Date of birth" variable in excel was imported to "15MAR2014:00:00:00" DATETIME19. format in SAS. I tried below approaches so far:
Approach1:
date=datepart(date_of_birth);
date1=input(put(date,8.),yymmdd8.);
Result: date1 variable with lots of sporadic missing with 5 digit numbers such as: 15367.
Approach2:
Shifting starting point in original excel file then import.
SAS_birthdate = excel_birthdate - 21916;
Result2: The same. Bunch of numbers in the close range of 15540 here and there with huge missing.
date=datepart(date_of_birth);
format date date9.;
Specify the RANGE option on PROC IMPORT. You can use the RANGE to specify a single cell to import each of the dates individually from the Excel file. Tedious but no real way around something like that.
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.