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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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