<?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 a serious of .xlsx files into SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/import-a-serious-of-xlsx-files-into-SAS/m-p/518517#M140339</link>
    <description>&lt;P&gt;You may use a Macro to accomplish this. Hope this helps. Note that the sas dataset name cannot be longer than 32 characters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%macro loopit;

%do i=1 %to 56;
proc import datafile = 'C:\Users\70660\Desktop\Datastream_original\Export_Pat_name_with_address_dis&amp;amp;i..xlsx' 
OUT=step5.Export_Pat_name_with_&amp;amp;i. DBMS=XLSX replace;

Sheet='Page 1';
RANGE='A1:F1001';
GETNAMES=YES;

RUN;
%end;
%mend;

%loopit&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 04 Dec 2018 18:37:21 GMT</pubDate>
    <dc:creator>r_behata</dc:creator>
    <dc:date>2018-12-04T18:37:21Z</dc:date>
    <item>
      <title>import a serious of .xlsx files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-a-serious-of-xlsx-files-into-SAS/m-p/518513#M140337</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I import a serious of files which named from 'Export_Pat_name_with_address_dis1' to 'Export_Pat_name_with_address_dis56' by using one code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can import each of them by&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile = 'C:\Users\70660\Desktop\Datastream_original\Export_Pat_name_with_address_dis1.xlsx' 
OUT=step5.Export_Pat_name_with_address_dis1 DBMS=XLSX replace;

Sheet='Page 1';
RANGE='A1:F1001';
GETNAMES=YES;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each of them&amp;nbsp;can use the same information like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Sheet='Page 1';
RANGE='A1:F1001';
GETNAMES=YES;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please give me some suggestion about this.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 18:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-a-serious-of-xlsx-files-into-SAS/m-p/518513#M140337</guid>
      <dc:creator>France</dc:creator>
      <dc:date>2018-12-04T18:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: import a serious of .xlsx files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-a-serious-of-xlsx-files-into-SAS/m-p/518517#M140339</link>
      <description>&lt;P&gt;You may use a Macro to accomplish this. Hope this helps. Note that the sas dataset name cannot be longer than 32 characters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%macro loopit;

%do i=1 %to 56;
proc import datafile = 'C:\Users\70660\Desktop\Datastream_original\Export_Pat_name_with_address_dis&amp;amp;i..xlsx' 
OUT=step5.Export_Pat_name_with_&amp;amp;i. DBMS=XLSX replace;

Sheet='Page 1';
RANGE='A1:F1001';
GETNAMES=YES;

RUN;
%end;
%mend;

%loopit&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Dec 2018 18:37:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-a-serious-of-xlsx-files-into-SAS/m-p/518517#M140339</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2018-12-04T18:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: import a serious of .xlsx files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-a-serious-of-xlsx-files-into-SAS/m-p/518524#M140344</link>
      <description>&lt;P&gt;Hello behata,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for your suggestion.&lt;/P&gt;&lt;P&gt;however, I get the result like&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;27   %macro loopit;
28
29   %do i=1 %to 56;
30   proc import datafile =
30 ! 'C:\Users\70660\Desktop\Datastream_original\Export_Pat_name_with_address_dis&amp;amp;i..xlsx'
31   OUT=step5.Export_Pat_name_with_&amp;amp;i. DBMS=XLSX replace;
32
33   Sheet='Page 1';
34   RANGE='A1:F1001';
35   GETNAMES=YES;
36
37   RUN;
38   %end;
39   %mend;
40
41   %loopit

ERROR: Physical file does not exist,
       C:\Users\70660\Desktop\Datastream_original\Export_Pat_name_with_address_dis&amp;amp;i..xlsx.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.39 seconds
      cpu time            0.03 seconds


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can use the following code to import each of them. like&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;42   proc import datafile =
42 ! 'C:\Users\70660\Desktop\Datastream_original\Export_Pat_name_with_address_dis1.xlsx'
43   OUT=step5.Export_Pat_name_with_1 DBMS=XLSX replace;
44
45   Sheet='Page 1';
46   RANGE='A1:F1001';
47   GETNAMES=YES;
48
49   RUN;

NOTE:    Variable Name Change.  Company name -&amp;gt; Company_name
NOTE:    Variable Name Change.  National ID -&amp;gt; National_ID
NOTE:    Variable Name Change.  Matched BvD ID -&amp;gt; Matched_BvD_ID
NOTE:    Variable Name Change.  Matched company name -&amp;gt; Matched_company_name
NOTE: The import data set has 1000 observations and 6 variables.
NOTE: STEP5.EXPORT_PAT_NAME_WITH_1 data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.48 seconds
      cpu time            0.04 seconds


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;could you please give me more advise?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 18:50:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-a-serious-of-xlsx-files-into-SAS/m-p/518524#M140344</guid>
      <dc:creator>France</dc:creator>
      <dc:date>2018-12-04T18:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: import a serious of .xlsx files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-a-serious-of-xlsx-files-into-SAS/m-p/518526#M140346</link>
      <description>&lt;P&gt;Sorry, my bad&amp;nbsp; the path was in single quotes . Now, try this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro loopit;

%do i=1 %to 56;
proc import datafile = "C:\Users\70660\Desktop\Datastream_original\Export_Pat_name_with_address_dis&amp;amp;i..xlsx"
OUT=step5.Export_Pat_name_with_&amp;amp;i. DBMS=XLSX replace;

Sheet='Page 1';
RANGE='A1:F1001';
GETNAMES=YES;

RUN;
%end;
%mend;

%loopit&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Dec 2018 18:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-a-serious-of-xlsx-files-into-SAS/m-p/518526#M140346</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2018-12-04T18:54:25Z</dc:date>
    </item>
  </channel>
</rss>

