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).
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.