<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Reading all/multiple excel files in Library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736603#M229508</link>
    <description>&lt;P&gt;I've done this, in a way.&amp;nbsp; I opened several Excel files in a SAS system at one time, but each file had its own LIBNAME.&amp;nbsp;&amp;nbsp;It involved writing SAS code that wrote SAS code for each LIBNAME statement.&amp;nbsp; I'm sure this is something I'm sure you will be capable of if you need to be.&amp;nbsp; Good luck.&amp;nbsp; I hope you find a satisfying solution to this.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Apr 2021 15:17:47 GMT</pubDate>
    <dc:creator>PhilC</dc:creator>
    <dc:date>2021-04-23T15:17:47Z</dc:date>
    <item>
      <title>Reading all/multiple excel files in Library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736593#M229500</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I have recently started learning SAS programming and question is related to accessing excel files.&lt;/P&gt;&lt;P&gt;I am using SAS Studio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In lesson 2 of SAS Programming 1, demonstration on using library to read SAS data table is provided.&lt;/P&gt;&lt;P&gt;As per demonstration with following libname, i was able to read/access all SAS Data tables/ data sets into PG1 Library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname pg1 "~/EPG1V2/data"; or&lt;/P&gt;&lt;P&gt;libname pg1 "/home/u48512862/EPG1V2/data";&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Similarly,&amp;nbsp;demonstration on using library to excel files is provided in lesson 2. However, it is limited to reading single excel work book; named as Class and following is libname statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname xlclass xlsx "~/EPG1V2/data/class.xlsx";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data sub folder under EPG1V2 also contains other excel file such as, eu_sport_trade.xlsx, np_info.xlsx and storm.xlsx.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way by which, one can read all excel files at once/ using single libname statement. (similar to that of all SAS data tables were read using&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;libname pg1 "~/EPG1V2/data";&amp;nbsp; &amp;nbsp; i remember here base is default engine is used for reading SAS Data tables).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help with code which will read all excel files from data sub folder into library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 14:13:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736593#M229500</guid>
      <dc:creator>evach</dc:creator>
      <dc:date>2021-04-23T14:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Reading all/multiple excel files in Library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736598#M229504</link>
      <description>&lt;P&gt;Wow.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname xlclass xlsx ("C:\Users\SaxophoneChihuahua\styles_vaLight.xlsx"
                      "C:\Users\SaxophoneChihuahua\styles.xlsx");
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I ran this and it worked.&amp;nbsp; I've learned something, i didn't expect it would work.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 15:00:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736598#M229504</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-04-23T15:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Reading all/multiple excel files in Library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736602#M229507</link>
      <description>&lt;P&gt;But it doesn't WORK! What I should have said was that it doesn't produce an error!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname xlclass xlsx ("C:\Users\SaxophoneChihuahua\styles_vaLight.xlsx"
                      "C:\Users\SaxophoneChihuahua\styles.xlsx");
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;... Each file had one spreadsheet and I could only access one of the one spreadsheet in the first file.&amp;nbsp; SAS showed me both spreadsheets, as if it might have worked.&amp;nbsp; bummer&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 15:20:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736602#M229507</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-04-23T15:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Reading all/multiple excel files in Library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736603#M229508</link>
      <description>&lt;P&gt;I've done this, in a way.&amp;nbsp; I opened several Excel files in a SAS system at one time, but each file had its own LIBNAME.&amp;nbsp;&amp;nbsp;It involved writing SAS code that wrote SAS code for each LIBNAME statement.&amp;nbsp; I'm sure this is something I'm sure you will be capable of if you need to be.&amp;nbsp; Good luck.&amp;nbsp; I hope you find a satisfying solution to this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 15:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736603#M229508</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-04-23T15:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading all/multiple excel files in Library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736606#M229511</link>
      <description>Unfortunately not as simply as you'd likely like, but it's definitely possible. &lt;BR /&gt;&lt;BR /&gt;This has a bug somewhere, IIRC, but I think it can get you started. If you find the bug, post back and I'll fix the main program.&lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Import_all_files_one_type" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Import_all_files_one_type&lt;/A&gt;</description>
      <pubDate>Fri, 23 Apr 2021 15:30:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736606#M229511</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-23T15:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reading all/multiple excel files in Library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736612#M229516</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15329"&gt;@PhilC&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;But it doesn't WORK! What I should have said was that it doesn't produce an error!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname xlclass xlsx ("C:\Users\SaxophoneChihuahua\styles_vaLight.xlsx"
                      "C:\Users\SaxophoneChihuahua\styles.xlsx");
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;... Each file had one spreadsheet and I could only access one of the one spreadsheet in the first file.&amp;nbsp; SAS showed me both spreadsheets, as if it might have worked.&amp;nbsp; bummer&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Did your example involve XLSX files with common sheet names? Since SAS uses the sheet name to build a data set name to reference in the library I would expect problems with common names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the reasons I expected this to be a poor idea was how many XLSX files have "sheet1" "sheet2". So whey you try use multiple XLSX files which "sheet1" would be available n the resulting library. I don't think we should expect the libname engine to provide a rename that would differentiate between the source file for the sheet name.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 15:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736612#M229516</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-23T15:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reading all/multiple excel files in Library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736630#M229526</link>
      <description>&lt;P&gt;They had different names.&amp;nbsp; Does this work for you!?&amp;nbsp; I dont think it works.&amp;nbsp; i could not open the other sheet, yet it appeared in the library, in my Enterprise Guide's GUI anyway.&amp;nbsp; I did only try it once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 17:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736630#M229526</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-04-23T17:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Reading all/multiple excel files in Library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736649#M229531</link>
      <description>I find XLSX a little buggy with showing the names of the sheets. Try actually referencing them if you know they exist and see what happens. Not ideal by any means.</description>
      <pubDate>Fri, 23 Apr 2021 18:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736649#M229531</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-23T18:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reading all/multiple excel files in Library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736676#M229538</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I find XLSX a little buggy with showing the names of the sheets. Try actually referencing them if you know they exist and see what happens. Not ideal by any means.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think you could end that comment at "buggy". &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I kind of resort to any of the XLSX code like LIbname or import as a last resort. One of the files I did use it on (because I had many&amp;nbsp; to deal with each having 50 or so tabs to extract small bits of data) kept showing "names" that were not even sheets in the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 21:29:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736676#M229538</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-23T21:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reading all/multiple excel files in Library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736678#M229540</link>
      <description>Yeah, Excel defined Tables or Named Ranges will also appear. Sometimes print ranges too...&lt;BR /&gt;Excel is the most used tool to do analysis though &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;</description>
      <pubDate>Fri, 23 Apr 2021 21:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-all-multiple-excel-files-in-Library/m-p/736678#M229540</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-23T21:31:25Z</dc:date>
    </item>
  </channel>
</rss>

