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

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