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.
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.
Instead of
RANGE="Sheet1$";
try
SHEET="'Sheet1$'";
Note the single quotes inside the double quotes.
No, its still gives an error.
ERROR: File _IMEX_.'Sheet1$'n.DATA does not exist.
ERROR: Import unsuccessful. See SAS Log for details.
I think you may have answered your own question... 'Sheet1$'n is, I think, they syntax you need to use.
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
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
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.
I know this is old - but for anyone coming across this in 2017 (like I just did) - my issue was that my workbook was apparently protected. Once I unprotected the workbook, I no longer got this error message.
The file you are importing may be protected or in read only mode.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.