<?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: CONCATENATING  MULTIPLE XLSX , XLS FILES INTO  ONE CSV FILE. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/CONCATENATING-MULTIPLE-XLSX-XLS-FILES-INTO-ONE-CSV-FILE/m-p/706434#M216815</link>
    <description>There is a Visual Basic script here that does something similar, it converts XML to XLSX. You can modify the file types via the extension and the number in the code to save the files as CSV instead.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://gist.github.com/statgeek/c51f58a009f8d315a200f34912e494b1" target="_blank"&gt;https://gist.github.com/statgeek/c51f58a009f8d315a200f34912e494b1&lt;/A&gt;</description>
    <pubDate>Wed, 16 Dec 2020 20:30:56 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-12-16T20:30:56Z</dc:date>
    <item>
      <title>CONCATENATING  MULTIPLE XLSX , XLS FILES INTO  ONE CSV FILE.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CONCATENATING-MULTIPLE-XLSX-XLS-FILES-INTO-ONE-CSV-FILE/m-p/706433#M216814</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I am a SAS programmer, I would like to convert&amp;nbsp; multiple XLSX AND XLS&amp;nbsp; file into single CSV file. I was wondering if there any method to do,&amp;nbsp; please help me to find the solution. I am using Sas windows environment 9.4 version.&lt;/P&gt;&lt;P&gt;Any suggestions would be very helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 20:39:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CONCATENATING-MULTIPLE-XLSX-XLS-FILES-INTO-ONE-CSV-FILE/m-p/706433#M216814</guid>
      <dc:creator>shailaja3</dc:creator>
      <dc:date>2020-12-16T20:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: CONCATENATING  MULTIPLE XLSX , XLS FILES INTO  ONE CSV FILE.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CONCATENATING-MULTIPLE-XLSX-XLS-FILES-INTO-ONE-CSV-FILE/m-p/706434#M216815</link>
      <description>There is a Visual Basic script here that does something similar, it converts XML to XLSX. You can modify the file types via the extension and the number in the code to save the files as CSV instead.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://gist.github.com/statgeek/c51f58a009f8d315a200f34912e494b1" target="_blank"&gt;https://gist.github.com/statgeek/c51f58a009f8d315a200f34912e494b1&lt;/A&gt;</description>
      <pubDate>Wed, 16 Dec 2020 20:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CONCATENATING-MULTIPLE-XLSX-XLS-FILES-INTO-ONE-CSV-FILE/m-p/706434#M216815</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-12-16T20:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: CONCATENATING  MULTIPLE XLSX , XLS FILES INTO  ONE CSV FILE.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CONCATENATING-MULTIPLE-XLSX-XLS-FILES-INTO-ONE-CSV-FILE/m-p/706464#M216822</link>
      <description>&lt;P&gt;You can use the XLSX or EXCEL library engine to read the data in an Excel worksheet, and ODS CSV to stack the data read in an output text file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Excel: Create three Excel files for example&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods noresults;

ods excel file='1.xlsx' options(sheet_name='Class');
proc print noobs data=sashelp.class; run;
ods excel close;

ods excel file='2.xlsx' options(sheet_name='Class');
proc print noobs data=sashelp.class; run;
ods excel close;

ods excel file='3.xlsx' options(sheet_name='Class');
proc print noobs data=sashelp.class; run;
ods excel close;

ods results;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;Code (Stack Excel data in CSV file)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods noresults;   /* prevent automatic opening when ODS destination closed */  

filename mycsv 'mydata_from_excel.csv';  /* destination file */

ods csv file=mycsv;                      /* open csv destination */
  libname workbook XLSX '1.xlsx';
  proc report data=workbook.Class; run;  /* write data from worksheet "class" in 1st xlsx to csv file with headers */
ods csv close;                           /* close csv file */

filename csv 'mydata_from_excel.csv' mod;   /* same filename (destination) with MOD option to force appending */

ods csv file=mycsv;                      /* open csv destination which is append only file */

libname workbook XLSX '2.xlsx';
proc report data=workbook.Class noheader; /* write data from worksheet "class" in 2nd xlsx to csv file with NO headers */
run;                                 

libname workbook XLSX '3.xlsx';
proc report data=workbook.Class noheader; /* write data from worksheet "class" in 3rd xlsx to csv file with NO headers */
run;

libname workbook;  /* clear libref to remove resource lock on excel file */
ods csv close;     /* close destination */

ods results;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Check results, output should be&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;"Name","Sex","Age","Height","Weight"
"Alfred","M",14,69,112.5
"Alice","F",13,56.5,84
"Barbara","F",13,65.3,98
"Carol","F",14,62.8,102.5
"Henry","M",14,63.5,102.5
"James","M",12,57.3,83
"Jane","F",12,59.8,84.5
"Janet","F",15,62.5,112.5
"Jeffrey","M",13,62.5,84
"John","M",12,59,99.5
"Joyce","F",11,51.3,50.5
"Judy","F",14,64.3,90
"Louise","F",12,56.3,77
"Mary","F",15,66.5,112
"Philip","M",16,72,150
"Robert","M",12,64.8,128
"Ronald","M",15,67,133
"Thomas","M",11,57.5,85
"William","M",15,66.5,112

"Alfred","M",14,69,112.5
"Alice","F",13,56.5,84
"Barbara","F",13,65.3,98
"Carol","F",14,62.8,102.5
"Henry","M",14,63.5,102.5
"James","M",12,57.3,83
"Jane","F",12,59.8,84.5
"Janet","F",15,62.5,112.5
"Jeffrey","M",13,62.5,84
"John","M",12,59,99.5
"Joyce","F",11,51.3,50.5
"Judy","F",14,64.3,90
"Louise","F",12,56.3,77
"Mary","F",15,66.5,112
"Philip","M",16,72,150
"Robert","M",12,64.8,128
"Ronald","M",15,67,133
"Thomas","M",11,57.5,85
"William","M",15,66.5,112

"Alfred","M",14,69,112.5
"Alice","F",13,56.5,84
"Barbara","F",13,65.3,98
"Carol","F",14,62.8,102.5
"Henry","M",14,63.5,102.5
"James","M",12,57.3,83
"Jane","F",12,59.8,84.5
"Janet","F",15,62.5,112.5
"Jeffrey","M",13,62.5,84
"John","M",12,59,99.5
"Joyce","F",11,51.3,50.5
"Judy","F",14,64.3,90
"Louise","F",12,56.3,77
"Mary","F",15,66.5,112
"Philip","M",16,72,150
"Robert","M",12,64.8,128
"Ronald","M",15,67,133
"Thomas","M",11,57.5,85
"William","M",15,66.5,112

&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 21:38:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CONCATENATING-MULTIPLE-XLSX-XLS-FILES-INTO-ONE-CSV-FILE/m-p/706464#M216822</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-12-16T21:38:43Z</dc:date>
    </item>
  </channel>
</rss>

