<?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 multiple Excel sheets into SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-Excel-sheets-into-SAS/m-p/549133#M152337</link>
    <description>&lt;P&gt;Use double quotes.&lt;/P&gt;
&lt;P&gt;Macro variables are not resolved inside single quotes.&lt;/P&gt;</description>
    <pubDate>Sun, 07 Apr 2019 21:39:25 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2019-04-07T21:39:25Z</dc:date>
    <item>
      <title>import multiple Excel sheets into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-Excel-sheets-into-SAS/m-p/549131#M152335</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to import multiple .excel sheets by following the code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro CountryN(country=,range=A1:);

proc import datafile = "I:\DATASTREAM\DATASTREAM_TOTAL.xlsx"
OUT=DATASTREAM_&amp;amp;country. DBMS=XLSX replace;
Sheet='&amp;amp;country.';
range=A1:'&amp;amp;range.';
GETNAMES=YES;
RUN;


%MEND CountryN;

%CountryN(country=Japan,range=V14595)
%CountryN(country=Netherlands,range=V1446)
%CountryN(country=New_Zealand,range=V960)
%CountryN(country=Norway,range=V1590)
%CountryN(country=Singapore,range=V2970)
%CountryN(country=Spain,range=V1665)
%CountryN(country=Sweden,range=V3663)
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;however, I get&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;4193  %macro CountryN(country=,range=);
4194
4195  proc import datafile = "I:\DATASTREAM\DATASTREAM_TOTAL.xlsx"
4196  OUT=DATASTREAM_&amp;amp;country. DBMS=XLSX replace;
4197  Sheet='&amp;amp;country.';
4198  RANGE='A1:&amp;amp;range.';
4199  GETNAMES=YES;
4200  RUN;
4201
4202
4203  %MEND CountryN;
4204
4205  %CountryN(country=Japan,range=V14595)

ERROR: Couldn't find sheet in spreadsheet

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

4206  %CountryN(country=Netherlands,range=V1446)



ERROR: Couldn't find sheet in spreadsheet

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

4207
4208  run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Could you please give me some suggestions&amp;nbsp;about this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2019 21:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-Excel-sheets-into-SAS/m-p/549131#M152335</guid>
      <dc:creator>Alexxxxxxx</dc:creator>
      <dc:date>2019-04-07T21:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: import multiple Excel sheets into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-Excel-sheets-into-SAS/m-p/549133#M152337</link>
      <description>&lt;P&gt;Use double quotes.&lt;/P&gt;
&lt;P&gt;Macro variables are not resolved inside single quotes.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2019 21:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-Excel-sheets-into-SAS/m-p/549133#M152337</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-04-07T21:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: import multiple Excel sheets into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-Excel-sheets-into-SAS/m-p/549134#M152338</link>
      <description>&lt;P&gt;As well as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;'s suggestion, try running this without the RANGE statement. Same error?&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2019 21:32:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-Excel-sheets-into-SAS/m-p/549134#M152338</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-04-07T21:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: import multiple Excel sheets into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-Excel-sheets-into-SAS/m-p/549272#M152384</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc import datafile = "I:\DATASTREAM\DATASTREAM_TOTAL.xlsx"
OUT=DATASTREAM_&amp;amp;country. DBMS=XLSX replace;

range="&amp;amp;country.$A1:&amp;amp;range.";

GETNAMES=YES;
RUN;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Apr 2019 14:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-Excel-sheets-into-SAS/m-p/549272#M152384</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-04-08T14:05:38Z</dc:date>
    </item>
  </channel>
</rss>

