BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
snsharma8930
Fluorite | Level 6

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:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 libname EXCELP XLSX '/home/snsharma89300/CertificationP/EXCELP.XLSX';
NOTE: Libref EXCELP was successfully assigned as follows:
Engine: XLSX
Physical Name: /home/snsharma89300/CertificationP/EXCELP.XLSX
72 run;
73
74 proc contents data= EXCELP._All_;
75 run;
 
WARNING: No matching members in directory.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

You must refer to each file separately

 

'/home/snsharma89300/CertificationP/EXCELP/file_example_XLSX_10.xlsx'

PG

View solution in original post

7 REPLIES 7
PGStats
Opal | Level 21

This occurs when the excel file doesn't exist. SAS assumes that you want to create the EXCELP.XLSX file.

PG
snsharma8930
Fluorite | Level 6
below are the files which i already uploaded in the  EXCELP folder.
 
 EXCELP
 file_example_XLSX_10 (1).xlsx
 file_example_XLSX_10.xlsx
 file_example_XLSX_100.xlsx
 file_example_XLSX_50.xlsx
 
 
PGStats
Opal | Level 21

You must refer to each file separately

 

'/home/snsharma89300/CertificationP/EXCELP/file_example_XLSX_10.xlsx'

PG
snsharma8930
Fluorite | Level 6

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.

Tom
Super User Tom
Super User

@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.

 

Quentin
Super User

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.

 

https://communities.sas.com/t5/SAS-Programming/Does-XLSX-engine-support-concatenated-libraries/td-p/...

 

I haven't tried it in more recent versions.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
snsharma8930
Fluorite | Level 6
thanks for the response.

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1882 views
  • 2 likes
  • 4 in conversation