<?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: import all sheets in excel file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/import-all-sheets-in-excel-file/m-p/435811#M108300</link>
    <description>&lt;P&gt;libname file XLSX 'C:\Users\.xlsx';&lt;BR /&gt;&lt;BR /&gt;proc copy in=file out=WORK;&lt;BR /&gt;run;quit;&lt;BR /&gt;&lt;BR /&gt;libname file;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So when I do this it copies all of the comments in rows 1-5 and the columns names in row 6 as observations. I just dont want to go and manually deleted these rows for each sheet.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2018 19:13:07 GMT</pubDate>
    <dc:creator>Melk</dc:creator>
    <dc:date>2018-02-09T19:13:07Z</dc:date>
    <item>
      <title>import all sheets in excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-all-sheets-in-excel-file/m-p/435803#M108295</link>
      <description>&lt;P&gt;I want to import all the sheets in an excel file with the following conditions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) import all sheets without having to specify sheet names (there are too many)&lt;/P&gt;&lt;P&gt;2) import row 6 as the heading (column name) and delete rows 1-5 for each sheet. Each sheet has the same column names.&lt;/P&gt;&lt;P&gt;3) Preferably wan to append each sheet to get 1 dataset. Again, each sheet as the same column names starting on row 6.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any tips to code this import?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 19:00:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-all-sheets-in-excel-file/m-p/435803#M108295</guid>
      <dc:creator>Melk</dc:creator>
      <dc:date>2018-02-09T19:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: import all sheets in excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-all-sheets-in-excel-file/m-p/435808#M108298</link>
      <description>&lt;P&gt;1. Assign a libname and get all the sheet names from the libname and proc datasets&lt;/P&gt;
&lt;P&gt;2. You can import them all using PROC COPY and then use a macro to process the data sets.&lt;/P&gt;
&lt;P&gt;3. You'll get mixed types when you import all of the data so you'll need to verify that first.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. if they're all the same data layout then add a rename manually to make it easier on yourself. You can easily do this by taking the first row of the worksheet, transpose it in excel (copy/paste special) and then align the letters which is what SAS will call the data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then build a rename statement:&lt;/P&gt;
&lt;P&gt;rename&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A =&amp;nbsp;ID&lt;/P&gt;
&lt;P&gt;B = Name&lt;/P&gt;
&lt;P&gt;C = SSN&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 19:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-all-sheets-in-excel-file/m-p/435808#M108298</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-09T19:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: import all sheets in excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-all-sheets-in-excel-file/m-p/435811#M108300</link>
      <description>&lt;P&gt;libname file XLSX 'C:\Users\.xlsx';&lt;BR /&gt;&lt;BR /&gt;proc copy in=file out=WORK;&lt;BR /&gt;run;quit;&lt;BR /&gt;&lt;BR /&gt;libname file;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So when I do this it copies all of the comments in rows 1-5 and the columns names in row 6 as observations. I just dont want to go and manually deleted these rows for each sheet.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 19:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-all-sheets-in-excel-file/m-p/435811#M108300</guid>
      <dc:creator>Melk</dc:creator>
      <dc:date>2018-02-09T19:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: import all sheets in excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-all-sheets-in-excel-file/m-p/435816#M108302</link>
      <description>&lt;P&gt;You can use the _N_ to process each sheet to delete the rows you don't need.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ultimately you're going to have to do some processing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The other option is to get the sheet names and then use a macro to import each sheet in turn using DATAROW to start at Row 7 but then you have to rename the variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 19:18:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-all-sheets-in-excel-file/m-p/435816#M108302</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-09T19:18:14Z</dc:date>
    </item>
  </channel>
</rss>

