<?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: Excel import macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Excel-import-macro/m-p/109371#M22709</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your little program will import the same sheet to three different datasets. You are changing the name of the target SAS dataset in the OUT= parameter, but you are NOT changing the name of the input Excel sheet in the SHEET= parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Sheet="Sheet&amp;amp;i$";&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Oct 2013 14:05:45 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2013-10-12T14:05:45Z</dc:date>
    <item>
      <title>Excel import macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-import-macro/m-p/109370#M22708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to import data from 3 Excel sheets into separate SAS datasets. I cannot figure out where I am messing up the macro - I suspect I am not defining "sheet" right (am I even definign "sheet"...?). This is also the first macro that I tried to write in SAS so that probably explains it. Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro import(sheet = );&lt;/P&gt;&lt;P&gt;%do i=1 %to 3 ;&lt;/P&gt;&lt;P&gt;proc import out = work.sheet&amp;amp;i.&lt;/P&gt;&lt;P&gt;datafile = "(location)"&lt;/P&gt;&lt;P&gt;DBMS=Excel Replace;&lt;/P&gt;&lt;P&gt;Sheet="Sheet$";&lt;/P&gt;&lt;P&gt;getnames = yes;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend import;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 15:49:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-import-macro/m-p/109370#M22708</guid>
      <dc:creator>fapg</dc:creator>
      <dc:date>2013-10-10T15:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Excel import macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-import-macro/m-p/109371#M22709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your little program will import the same sheet to three different datasets. You are changing the name of the target SAS dataset in the OUT= parameter, but you are NOT changing the name of the input Excel sheet in the SHEET= parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Sheet="Sheet&amp;amp;i$";&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Oct 2013 14:05:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-import-macro/m-p/109371#M22709</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-10-12T14:05:45Z</dc:date>
    </item>
  </channel>
</rss>

