BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8
Hi,
This is a nagging problem when converting excel data to SAS datasets especially with the date fields.
I have this field ship_date where some values are of fomat 02/21/2007 and some are of 2/2/2007.
As first step, I create a new column in excel convert all ship_date values to character and then import to SAS. Even then there are some values which wouldnt convert to the expected in excel either.2/22/2007 remains as is so I have to add a zero before month and year and then do the data conversion.
This will take up long time to clean/modfiy formats.
I'm wondering if there is any other technique that will help reduce this manual intervention?
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Try using INFORMAT ANYDTDTE. for your input conversion.

Scott Barry
SBBWorks, Inc.
SASPhile
Quartz | Level 8
I'm using import wizard
Doc_Duke
Rhodochrosite | Level 12
There is a fair chance that the 2/2/2007 date in excel is actually entered in the cell as 2/2/2007 and that excel, in it's fashion is just storing text in a column meant for a date. It looks like a date, but it is not.

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