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

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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