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. 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 6721 views
  • 4 likes
  • 5 in conversation