BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cruise
Ammonite | Level 13

@Reeza

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

 

Reeza
Super User
date=datepart(date_of_birth);
format date date9.;
Cruise
Ammonite | Level 13
Thank you very much. It solved the problem.
Reeza
Super User

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 18 replies
  • 3840 views
  • 4 likes
  • 5 in conversation