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.
>No worksheets in the .XLSX file.
How many sheets in your file? Did you try the sheet= statement?
Just one sheet and yes, tried with the SHEET option as well with the same ERROR message.
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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.