BookmarkSubscribeRSS Feed
HitmonTran
Pyrite | Level 9

Hi,

 

When importing my excel sheet, the date/time conversion is not correct.  Only method that worked was converting it into CSV file but then I would have to format the rest of the columns.

 

I also tried "41000" method of -21916 but that didn't work.  Below is a screenshot of the excel and the values it looks like after importing.

 

Someone please help import the correct dates, Thanks.

 

asdf.jpg

 

4 REPLIES 4
PGStats
Opal | Level 21

"but that didn't work" is not a useful description of what went wrong. SAS converts some date variables when it recognizes an Excel date format, but it misses some. You can either change the format in Excel so that it is recognized by SAS as a date format, or do your own convversion in SAS after importing.  

PG
HitmonTran
Pyrite | Level 9
I did a format change to "date" but values still remained the same with a decimal. Tried using sas date format and it gives me a missing value.
PGStats
Opal | Level 21

Please show the SAS code you are using.

PG
Reeza
Super User

Are those supposed to be the same values?
The standard correction methods don't work and I don't understand why....

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 4 replies
  • 651 views
  • 0 likes
  • 3 in conversation