<?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: How to read data from multiple excel files into a single dataset in SAS in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-read-data-from-multiple-excel-files-into-a-single-dataset/m-p/743382#M38854</link>
    <description>LIBNAME myEXCEL2 XLSX 'C:\somewhere\MySpreadsheetA.XLSX;&lt;BR /&gt;LIBNAME myEXCEL2 XLSX 'D:\somewhere\MySpreadsheed2.XLSX;&lt;BR /&gt;&lt;BR /&gt;Data combined; set&lt;BR /&gt;set myExcel1.TabName1&lt;BR /&gt;myExcel1.TabName2&lt;BR /&gt;myExcel2.TabNameX&lt;BR /&gt;myExcel2.TabNameZ;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;*&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acpcref/n0oj9f6i838mymn148890ckla700.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acpcref/n0oj9f6i838mymn148890ckla700.htm&lt;/A&gt;</description>
    <pubDate>Mon, 24 May 2021 14:59:18 GMT</pubDate>
    <dc:creator>TonyLMayo</dc:creator>
    <dc:date>2021-05-24T14:59:18Z</dc:date>
    <item>
      <title>How to read data from multiple excel files into a single dataset in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-read-data-from-multiple-excel-files-into-a-single-dataset/m-p/743317#M38852</link>
      <description>Hi All ,&lt;BR /&gt;&lt;BR /&gt;I trust you all are doing good.&lt;BR /&gt;I have a project where i have to import multiple excel files from a sas folder into a single sas dataset.&lt;BR /&gt;All the files have same numbers of columns and have xlsx format.&lt;BR /&gt;Can you guys please help me in that?&lt;BR /&gt;&lt;BR /&gt;Thank you in advance</description>
      <pubDate>Mon, 24 May 2021 08:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-read-data-from-multiple-excel-files-into-a-single-dataset/m-p/743317#M38852</guid>
      <dc:creator>Nimish28</dc:creator>
      <dc:date>2021-05-24T08:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data from multiple excel files into a single dataset in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-read-data-from-multiple-excel-files-into-a-single-dataset/m-p/743337#M38853</link>
      <description>&lt;P&gt;Excel files are very ill-suited for this, as the import into SAS (via LIBNAME XLSX or PROC IMPORT) will produce different column attributes (even the type, character or numeric!) depending on the contents.&lt;/P&gt;
&lt;P&gt;If you have clean, constant content (fixed length, no completely missing columns), something like this might work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro imp_excel(filename);
proc import
  datafile="&amp;amp;filename"
  out=temp
  dbsm=xlsx
  replace
;
run;

proc append
  data=temp
  base=want
  force
;
run;
%mend;

data _null_;
length fref $8 fname $200;
rc = filename(fref,"path_to_your_excel_files");
did = dopen(fref);
if did ne 0
then do;
  do i = 1 to dnum(did);
    fname = catx("/","path_to_your_excel_files",dread(did,i));
    if lowcase(scan(fname,-1,'.')) = 'xlsx' then call execute(cats('%imp_excel(',fname,')'));
  end;
  rc = dclose(did);
end;
rc = filename(fref);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 May 2021 10:57:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-read-data-from-multiple-excel-files-into-a-single-dataset/m-p/743337#M38853</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-05-24T10:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data from multiple excel files into a single dataset in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-read-data-from-multiple-excel-files-into-a-single-dataset/m-p/743382#M38854</link>
      <description>LIBNAME myEXCEL2 XLSX 'C:\somewhere\MySpreadsheetA.XLSX;&lt;BR /&gt;LIBNAME myEXCEL2 XLSX 'D:\somewhere\MySpreadsheed2.XLSX;&lt;BR /&gt;&lt;BR /&gt;Data combined; set&lt;BR /&gt;set myExcel1.TabName1&lt;BR /&gt;myExcel1.TabName2&lt;BR /&gt;myExcel2.TabNameX&lt;BR /&gt;myExcel2.TabNameZ;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;*&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acpcref/n0oj9f6i838mymn148890ckla700.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acpcref/n0oj9f6i838mymn148890ckla700.htm&lt;/A&gt;</description>
      <pubDate>Mon, 24 May 2021 14:59:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-read-data-from-multiple-excel-files-into-a-single-dataset/m-p/743382#M38854</guid>
      <dc:creator>TonyLMayo</dc:creator>
      <dc:date>2021-05-24T14:59:18Z</dc:date>
    </item>
  </channel>
</rss>

