Unusual date problem

C

CD

I received an excell file from a company and made corrections to it. The
dates that came from the company are formatted as "general", but they display
as MM/DD/YYYY. When we added dated to the file, (MM/DD/YYYY) they were added
as the Date format *M/D/YY. When I tried to change them to general, they
displayed as a number, not a date. When I import the file into SAS, they are
read as numeric variables. Is there any way to format all of the dates in
the spread sheet so that they are read as the same variable type by SAS?
THANK YOU!
 
R

Ron Rosenfeld

I received an excell file from a company and made corrections to it. The
dates that came from the company are formatted as "general", but they display
as MM/DD/YYYY. When we added dated to the file, (MM/DD/YYYY) they were added
as the Date format *M/D/YY. When I tried to change them to general, they
displayed as a number, not a date. When I import the file into SAS, they are
read as numeric variables. Is there any way to format all of the dates in
the spread sheet so that they are read as the same variable type by SAS?
THANK YOU!

It is likely that the original Excel file you received had the dates as TEXT
fields and not as true Excel dates. The latter are stored as serial numbers,
where 1 = 1 Jan 1900.

The dates you subsequently added were converted by Excel into true Excel dates.

I'm not familiar with SAS or it's importing rules. Working in Excel, I would
change the dates in your imported file into "real Excel dates". One way of
doing this is to select the dates in that company file; then
Data/Text-to-Columns and when you get to the appropriate screen, select Date
for the type of information and MDY for the format.

After that, all your dates in Excel will be "proper dates". What you will need
to do subsequently, to have SAS interpret these properly, is knowledge that is
"above my pay grade".

--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top