Hi Team,
I am trying to create library with XLSX engine & the library is creating successfully with XLSX Engine, however no XLSX file imported in the XLSX library. Please find below the code:
1) libname EXCELP XLSX '/home/snsharma89300/CertificationP/EXCELP.XLSX'; (underline is path of my sas studio library where i saved all xlsx files. )
below is log:
You must refer to each file separately
'/home/snsharma89300/CertificationP/EXCELP/file_example_XLSX_10.xlsx'
This occurs when the excel file doesn't exist. SAS assumes that you want to create the EXCELP.XLSX file.
You must refer to each file separately
'/home/snsharma89300/CertificationP/EXCELP/file_example_XLSX_10.xlsx'
Thanks for reply. If I refer the each file separately then file is successfully available in library, But my concern is why all files are not coming together.
@snsharma8930 wrote:
Thanks for reply. If I refer the each file separately then file is successfully available in library, But my concern is why all files are not coming together.
A libref in SAS points to a location with multiple individual datasets. An XLSX workbook consists of multiple individual worksheets. So when you make a libref using the XLSX engine you point it to one workbook. You can then use it to access all of the sheets in that one workbook. If you want to access all of the sheets in all of the workbooks then you will need to use multiple LIBNAME statements. Either with different libref names, or the same name over and over in a loop.
Was going to add that you could use a concatenated library with the XLSX engine to point to multiple Excel files (assuming sheet names are unique).
But then I remembered that a couple years ago, I discovered it doesn't work.
I haven't tried it in more recent versions.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.