Query the proper DICTIONARY table:
libname inexcel xlsx '/home/sandhyatippur/cert/input/test_tabs.xlsx';
proc sql;
select memname from dictionary.tables where libname = "INEXCEL";
quit;
libname inexcel xlsx '/home/sandhyatippur/cert/input/test_tabs.xlsx';
proc import datafile="/home/sandhyatippur/cert/input/test_tabs.xlsx"
out=test dbms=xlsx
replace;
getnames=yes;
run;
Add this line of code right before your LIBNAME statement, and respond with the result shown in the log:
%put &=SYSSCPL;
Vince DelGobbo
SAS R&D
Libnames in SAS can be written in lowercase, but SAS itself keeps them always in uppercase, so your SQL statement must be:
select memname from dictionary.tables where libname ="INEXCEL";
to have any chance of succeeding.
If the SQL still returns no rows, then the Excel file has no sheets (unlikely), or it is not there (very likely).
The success of the LIBNAME statement tells you nothing, as it can be used in this way to create a new Excel file (which will be created physically when the first table is written to it).
When SAS tells you a file is not there, then it is not there, period.
Check the presence of the file (log on to the server and do directory listings with ls), and make sure you have the correct spelling (keep in mind that the UNIX system is case sensitive, Test_tabs.xlsx is different from test_tabs.xlsx).
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 25. Read more here about why you should contribute and what is in it for you!
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.