<?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 different sheets of excel file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Exporting-multiple-SAS-datasets-into-different-sheets-of-excel/m-p/482056#M124801</link>
    <description>&lt;P&gt;I already have SHEET= option in macro&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jul 2018 21:04:05 GMT</pubDate>
    <dc:creator>petlove</dc:creator>
    <dc:date>2018-07-27T21:04:05Z</dc:date>
    <item>
      <title>Exporting multiple SAS datasets into different sheets of excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-multiple-SAS-datasets-into-different-sheets-of-excel/m-p/481989#M124776</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create one excel file with different sheets for each dataset by using proc export. Following is my macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro export;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;libname output "XXXXX";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let domains=AE#DM;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%do i = 1 %to %eval(%sysfunc(count(&amp;amp;domains,#))+1);&lt;BR /&gt;%let dsn=%scan(&amp;amp;domains,&amp;amp;i,#);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc export data=&amp;amp;dsn label&lt;BR /&gt;dbms=xlsx&lt;BR /&gt;outfile="test.xlsx"&lt;BR /&gt;replace;&lt;BR /&gt;;&lt;BR /&gt;sheet="&amp;amp;dsn.out" ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;options merror serror symbolgen mlogic;&lt;BR /&gt;%export;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This macro overrides the existing sheet of AE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know how to not override the previous sheet or append these sheets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 19:04:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-multiple-SAS-datasets-into-different-sheets-of-excel/m-p/481989#M124776</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2018-07-27T19:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting multiple SAS datasets into different sheets of excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-multiple-SAS-datasets-into-different-sheets-of-excel/m-p/481993#M124777</link>
      <description>&lt;P&gt;Use "options mprint symbolgen;" as well as some %put statements to check the values of those parameters and see what is happening in each iteration of hte loop. It looks to me like the sheet names it would write out would be AEout.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 19:14:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-multiple-SAS-datasets-into-different-sheets-of-excel/m-p/481993#M124777</guid>
      <dc:creator>cau83</dc:creator>
      <dc:date>2018-07-27T19:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting multiple SAS datasets into different sheets of excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-multiple-SAS-datasets-into-different-sheets-of-excel/m-p/481994#M124778</link>
      <description>&lt;P&gt;You can add the SHEET= along with the REPLACE option to your PROC EXPORT step.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 19:15:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-multiple-SAS-datasets-into-different-sheets-of-excel/m-p/481994#M124778</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-07-27T19:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting multiple SAS datasets into different sheets of excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-multiple-SAS-datasets-into-different-sheets-of-excel/m-p/482056#M124801</link>
      <description>&lt;P&gt;I already have SHEET= option in macro&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 21:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-multiple-SAS-datasets-into-different-sheets-of-excel/m-p/482056#M124801</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2018-07-27T21:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting multiple SAS datasets into different sheets of excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-multiple-SAS-datasets-into-different-sheets-of-excel/m-p/482170#M124842</link>
      <description>&lt;P&gt;libname x xlsx 'c:\temp\want.xlsx' ;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;libname x excel 'c:\temp\want.xlsx';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc copy in=work out=x;&lt;/P&gt;
&lt;P&gt;select ae stdm;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Jul 2018 11:42:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-multiple-SAS-datasets-into-different-sheets-of-excel/m-p/482170#M124842</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-07-28T11:42:18Z</dc:date>
    </item>
  </channel>
</rss>

