<?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: exporting multiple sas datasets into multiple sheets in one excel workbook in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/exporting-multiple-sas-datasets-into-multiple-sheets-in-one/m-p/152531#M30037</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Reeza! That's so silly of me .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Sep 2014 18:15:01 GMT</pubDate>
    <dc:creator>esita</dc:creator>
    <dc:date>2014-09-19T18:15:01Z</dc:date>
    <item>
      <title>exporting multiple sas datasets into multiple sheets in one excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exporting-multiple-sas-datasets-into-multiple-sheets-in-one/m-p/152529#M30035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Hi All,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I'm trying to export multiple sas datasets to excel where my multiple sas datasets are multiple sheets in 1 excel file. I wrote a macro for this. I'm sure I made some mistakes as I'm new to macro and still in learning phase. I have about 40 sas datasets. I would really appreciate if you could help me with this.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thanks,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Esita&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;libname a "c:\sasdata";&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%macro export_data(file=,data=,sheet=);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc export data=&amp;amp;data.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;outfile="&amp;amp;file."&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;dbms=excel replace;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;sheet="&amp;amp;sheet.";&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%mend export_data;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%imp (file= "c:\sasdata\blood_result.xls",data= a.rbc,sheet= rbc);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%imp (file= "c:\sasdata\blood_result.xls",data= a.wbc,sheet= wbc);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 16:59:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exporting-multiple-sas-datasets-into-multiple-sheets-in-one/m-p/152529#M30035</guid>
      <dc:creator>esita</dc:creator>
      <dc:date>2014-09-19T16:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: exporting multiple sas datasets into multiple sheets in one excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exporting-multiple-sas-datasets-into-multiple-sheets-in-one/m-p/152530#M30036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're calling the macro incorrectly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You've named it export_data so replace %imp with %export_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, if you're using SAS Analytics U you'll need to make sure your path is UNIX compatible. The one above looks to be a windows path. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 17:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exporting-multiple-sas-datasets-into-multiple-sheets-in-one/m-p/152530#M30036</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-19T17:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: exporting multiple sas datasets into multiple sheets in one excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exporting-multiple-sas-datasets-into-multiple-sheets-in-one/m-p/152531#M30037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Reeza! That's so silly of me .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 18:15:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exporting-multiple-sas-datasets-into-multiple-sheets-in-one/m-p/152531#M30037</guid>
      <dc:creator>esita</dc:creator>
      <dc:date>2014-09-19T18:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: exporting multiple sas datasets into multiple sheets in one excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exporting-multiple-sas-datasets-into-multiple-sheets-in-one/m-p/319082#M69996</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I tried following the similar steps but the exported xls is not showing any data. Please find my code below:&lt;/P&gt;&lt;P&gt;%macro export_data = (file=,data=,sheet=);&lt;BR /&gt;proc export data= "&amp;amp;data."&lt;BR /&gt;outfile= "&amp;amp;file."&lt;BR /&gt;dbms=xls replace;&lt;BR /&gt;sheet="&amp;amp;sheet.";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend export_data;&lt;BR /&gt;%export_data (file= "D:\SAS\export_files\multiexp.xls",data= sashelp.class,sheet= class);&lt;BR /&gt;%export_data (file= "D:\SAS\export_files\multiexp.xls",data= sashelp.cars,sheet= cars);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you!!!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 00:54:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exporting-multiple-sas-datasets-into-multiple-sheets-in-one/m-p/319082#M69996</guid>
      <dc:creator>SASJack</dc:creator>
      <dc:date>2016-12-15T00:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: exporting multiple sas datasets into multiple sheets in one excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exporting-multiple-sas-datasets-into-multiple-sheets-in-one/m-p/319083#M69997</link>
      <description>&lt;P&gt;Start a new discussion. &amp;nbsp;You have added quotes to your filename twice. Once in the macro and once in the call.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 01:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exporting-multiple-sas-datasets-into-multiple-sheets-in-one/m-p/319083#M69997</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-12-15T01:03:11Z</dc:date>
    </item>
  </channel>
</rss>

