BookmarkSubscribeRSS Feed
Avi02
Calcite | Level 5

Hi:

I am trying to import a XLSX file and convert to a SAS dataset, but for some reason I get the below message in SAS Log which is very vague with no ERROR codes shown:

SAS Code:

proc import datafile='../view/abc.xlsx'

dbms=xlsx replace

out=work.abc;

getnames=yes;

run;

 

SAS log message:

"No worksheets in the .XLSX file.

Requested input file is invalid.

ERROR: Import unsuccessful. See SAS Log for Details"

 

SAS Software 9.4 (TS1M5) being run on Linux 3.10.0-957.21.3.el7.x86_64 (LIN X64) platform.

 

Am I missing something here? Anyways to resolve this?

 

Thank you,

Avi.

 

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

>No worksheets in the .XLSX file.

How many sheets in your file? Did you try the sheet= statement?

Avi02
Calcite | Level 5

Just one sheet and yes, tried with the SHEET option as well with the same ERROR message.

ChrisNZ
Tourmaline | Level 20

SAS does not see that sheet. It probably has some special attributes, though I am unsure what these might be. Try creating a new sheet with the same contents. Not that Excel provides no metadata, so reading an Excel file yields unpredictable results in terms of variable type or length.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 2156 views
  • 0 likes
  • 2 in conversation