BookmarkSubscribeRSS Feed
DingDing
Quartz | Level 8

 

The first question is that I can import the EXCEL file. It is a very simple line, but I can find what the problem is 

 

PROC IMPORT DATAFILE='D:\sasprogramming\Ex1.xlsx'  OUT= Ex1 DBMS=xlsx REPLACE;
RUN;

here is the log:

ERROR: Error opening XLSX file -> D:\sasprogramming\THEORY\Class_2\Home_Exercises\Ex1.xlsx .  It is either not an Excel spreadsheet 
or it is damaged.   Error code=80000808
Requested Input File Is Invalid
ERROR: Import unsuccessful.  See SAS Log for details.

The Excel file (see attachement) is complete and I can open it smoothly, so I really wonder where the problem is.

 

The second question: I am a new SAS EG user, and everytime I run the same line it creates a new process in the left area. It looks weird, so I am wondering is it normal? If not, what can I do for this?

2016-07-17_163823.png

 

 

 

 

 

 

 

 

 

 

6 REPLIES 6
Tom
Super User Tom
Super User

Your XLSX file looks fine. What version of SAS are you using?

154   libname x xlsx "&path\Ex1.xlsx";
NOTE: Libref X was successfully assigned as follows:
      Engine:        XLSX
      Physical Name: C:\Downloads\Ex1.xlsx
155   proc copy inlib=x outlib=work; run;

NOTE: Copying X.SHEET1 to WORK.SHEET1 (memtype=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used.
NOTE: The import data set has 395 observations and 100 variables.
NOTE: There were 395 observations read from the data set X.SHEET1.
NOTE: The data set WORK.SHEET1 has 395 observations and 100 variables.
NOTE: Copying X.SHEET2 to WORK.SHEET2 (memtype=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used.
NOTE: The import data set has 0 observations and 0 variables.
NOTE: There were 0 observations read from the data set X.SHEET2.
NOTE: The data set WORK.SHEET2 has 0 observations and 0 variables.
NOTE: Copying X.SHEET3 to WORK.SHEET3 (memtype=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used.
NOTE: The import data set has 0 observations and 0 variables.
NOTE: There were 0 observations read from the data set X.SHEET3.
NOTE: The data set WORK.SHEET3 has 0 observations and 0 variables.
DingDing
Quartz | Level 8
Hi, I use SAS enterprise guide 7. Can you import the data file with the same codes?
Reeza
Super User

Resave your file. 

Open it and save as XLSX workbook. I tried to preview it and it wouldn't open in my viewer so that would indicate that there is something abnormal with the file to me. 

 

The proc copy will import all the sheets in the workbook which may or may not be what you want. 

DingDing
Quartz | Level 8

Thank you very much @Reeza and @Tom, I found I make a stupid mistake that I run SAS through a server, so I shouldn't run it through a local path. Now my first question is solved, but still the second question is still confusing. Do you have any idea about that? Why I everytime I run the code, it automatically create a sas2(2), sas2(2)(2),sas2(2)(2), sas2(2)(2) and so on. Are they normal?

Reeza
Super User

No, that's not normal. Check the options and see if you have an autosave of some kind set up. That's the only thing I could think that would create a copy each time. 

DingDing
Quartz | Level 8
Hi, it's from a remote server, so the setting is automatically, and I can't change any seting up

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 4240 views
  • 0 likes
  • 3 in conversation