<?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: combine three excels in datastep and proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/combine-three-excels-in-datastep-and-proc-sql/m-p/883284#M348991</link>
    <description>&lt;P&gt;To "stack" datasets in SQL, one has to use the UNION clause, which you already have done.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jul 2023 05:02:27 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-07-03T05:02:27Z</dc:date>
    <item>
      <title>combine three excels in datastep and proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/combine-three-excels-in-datastep-and-proc-sql/m-p/883281#M348990</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro import(file,dname);	
   Proc import datafile="&amp;amp;file" out=&amp;amp;dname
   Dbms=xlsx replace;
   Getnames=yes;
   Run;
%mend;
%import(/home/u35263349/My_Folder/sheet1.xlsx,ds1);
%import(/home/u35263349/My_Folder/sheet2.xlsx,ds2);
%import(/home/u35263349/My_Folder/sheet3.xlsx,ds3);

proc sql;
create table transaction as
select * from ds1
union all
select * from ds2
union all
select * from ds3;
quit;

data master;
set ds1 ds2 ds3;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hi Guys i want to import these excel files&amp;nbsp; dynamically and combine three datasets i tried data step and proc sql&amp;nbsp; please suggest any alternative method using proc sql&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 04:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/combine-three-excels-in-datastep-and-proc-sql/m-p/883281#M348990</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2023-07-03T04:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: combine three excels in datastep and proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/combine-three-excels-in-datastep-and-proc-sql/m-p/883284#M348991</link>
      <description>&lt;P&gt;To "stack" datasets in SQL, one has to use the UNION clause, which you already have done.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 05:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/combine-three-excels-in-datastep-and-proc-sql/m-p/883284#M348991</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-07-03T05:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: combine three excels in datastep and proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/combine-three-excels-in-datastep-and-proc-sql/m-p/883316#M349000</link>
      <description>&lt;P&gt;Your SQL code works with your sample Excels. What's the problem/your question.&lt;/P&gt;
&lt;P&gt;In case in your real data the columns in the Excels are not always in the same order: Use&amp;nbsp;&lt;EM&gt; union all &lt;STRONG&gt;CORR&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 11:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/combine-three-excels-in-datastep-and-proc-sql/m-p/883316#M349000</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-07-03T11:04:21Z</dc:date>
    </item>
  </channel>
</rss>

