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.

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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
  • 4170 views
  • 0 likes
  • 2 in conversation