Help using Base SAS procedures

Problem in importing excel file

Reply
Frequent Contributor
Posts: 92

Problem in importing excel file

Hi,

I am trying to import an excel file with 65000+ observations and 20 variable however i am receiving an error message while importing the file in sas. Below is the error message and the code used for

importing the same:-

PROC IMPORT OUT= WORK.Trans

            DATAFILE= "F:\dell blue\Data Backup 05-02-2014\Downloads\SAS

Study Material\Statisitical Projects\Delay Transport Data\Delay_Status_

Data.xls"

            DBMS=EXCEL REPLACE;

     RANGE="Sheet1$";

     GETNAMES=YES;

     MIXED=NO;

     SCANTEXT=YES;

     USEDATE=YES;

     SCANTIME=YES;

RUN;

Error Mesage:-

WARNING: Failed to scan text length or time type for column ( same error message for multiple columns)

Kindly advice.

Super User
Super User
Posts: 7,392

Re: Problem in importing excel file

The range="Sheet1$" looks a bit odd.  what happens if you just put the proc import line and run (i.e. no other options).  Also as a suggestion convert to CSV.

Occasional Contributor
Posts: 6

Re: Problem in importing excel file

Instead of

RANGE="Sheet1$";

try

SHEET="'Sheet1$'";

Note the single quotes inside the double quotes.

Frequent Contributor
Posts: 92

Re: Problem in importing excel file

No, its still gives an error.

ERROR: File _IMEX_.'Sheet1$'n.DATA does not exist.

ERROR: Import unsuccessful.  See SAS Log for details.

Contributor
Posts: 27

Re: Problem in importing excel file

I think you may have answered your own question...  'Sheet1$'n is, I think, they syntax you need to use.

Occasional Contributor
Posts: 6

Re: Problem in importing excel file

Is the excel tab name exactly 'Sheet1'? No leading or trailing spaces? (I ran into that once...)

You are getting a different error message, so it looks like progress. Now the error points to a mismatch between what you have in the SHEET statement and what is on your excel tab label.

I have code that I use everyday....

SHEET="'JRM Data$'";

the label on the excel tab is: JRM Data

Brent

Occasional Contributor
Posts: 6

Re: Problem in importing excel file

Oh, and one other option.

Run the import wizard, and utilize the last step where it saves the SAS code into a file. Then look at that code to see what it shows.

Brent

New Contributor
Posts: 2

Re: Problem in importing excel file

Is there really an _error_ or only the  warning you mention?

What´s the exact problem? Are there really missing or wrong data?

Maybe the warning is only about an empty column.

Ask a Question
Discussion stats
  • 7 replies
  • 2236 views
  • 0 likes
  • 5 in conversation