Date conversion error when I use proc import in SAS EG 5.1

Accepted Solution Solved
Reply
Contributor
Posts: 59
Accepted Solution

Date conversion error when I use proc import in SAS EG 5.1

When I import excel file into SAS dataset in EG 5.1, I got variables with date format error.

I use  : Proc Import datafile= <excel file.xls>

                            out=<sas dataset>

                            dbms=xls  replace;

                            getnames=yes;

All input fields are OK, only date fields have problems like that :

Excel format    SAS read in             SAS read in format

6/26/2014        41816                        06/27/2074

10/8/2013        41555                        10/09/2073

5/9/2011         40672                         05/10/2071

........................................

SAS read in date fields which are off 60 years and 1 day in each value.

The option yearcutoff = 1920 in default.

Would you mind giving me a direction to resolve this problem.

Thanks in advance.

----------------------------

WT1968


Accepted Solutions
Solution
‎01-10-2015 09:41 AM
PROC Star
Posts: 7,431

Re: Date conversion error when I use proc import in SAS EG 5.1


All Replies
Super User
Posts: 9,856

Re: Date conversion error when I use proc import in SAS EG 5.1

not sure if it could work. Did you try other engine ,like dbms=excel  dbms=xlsx .

options datestyle=mdy;

Solution
‎01-10-2015 09:41 AM
PROC Star
Posts: 7,431

Re: Date conversion error when I use proc import in SAS EG 5.1

Contributor
Posts: 59

Re: Date conversion error when I use proc import in SAS EG 5.1

Thanks for all information. I appreciate your help to solve my problem quickly.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 5193 views
  • 3 likes
  • 3 in conversation