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