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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2372 views
  • 0 likes
  • 2 in conversation