<?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: Export to different Excel sheets based on variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-to-different-Excel-sheets-based-on-variable/m-p/865979#M341987</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Excel sheets can be created like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc Export data=sashelp.class
   outfile="C:\Temp\yourFile.xlsx"
   dbms=EXCEL
   Replace;
  sheet='Class';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Simply repeat the operation for several sheets&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2023 16:10:07 GMT</pubDate>
    <dc:creator>Oligolas</dc:creator>
    <dc:date>2023-03-23T16:10:07Z</dc:date>
    <item>
      <title>Export to different Excel sheets based on variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-different-Excel-sheets-based-on-variable/m-p/865961#M341979</link>
      <description>&lt;P&gt;Hello, I'm trying to export data from a SAS table to different sheets based on a variable's values (variable=site).&amp;nbsp; I also need to sort by a few variables (date and type) before export, which is the reason I cannot use the code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ods excel file="\\filepath\file.xlsx"&lt;BR /&gt;options(sheet_interval="BYGROUP");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc print data=doc noobs;&lt;BR /&gt;by site ;&lt;BR /&gt;run;&lt;BR /&gt;ods excel close;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-different-Excel-sheets-based-on-variable/m-p/865961#M341979</guid>
      <dc:creator>jmmedina252</dc:creator>
      <dc:date>2023-03-23T15:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Export to different Excel sheets based on variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-different-Excel-sheets-based-on-variable/m-p/865971#M341985</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439355"&gt;@jmmedina252&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello, I'm trying to export data from a SAS table to different sheets based on a variable's values (variable=site).&amp;nbsp; I also need to sort by a few variables (date and type) before export, which is the reason I cannot use the code below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;ods excel file="\\filepath\file.xlsx"&lt;BR /&gt;options(sheet_interval="BYGROUP");&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc print data=doc noobs;&lt;BR /&gt;by site ;&lt;BR /&gt;run;&lt;BR /&gt;ods excel close;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What exactly makes you think that you can't use this?? If you Sort the data by SITE DATE and TYPE then the result of Print by Site is one sheet per site with the data in Date and Type order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are not successfully describing what your output requirement might be.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:38:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-different-Excel-sheets-based-on-variable/m-p/865971#M341985</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-23T15:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Export to different Excel sheets based on variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-different-Excel-sheets-based-on-variable/m-p/865979#M341987</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Excel sheets can be created like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc Export data=sashelp.class
   outfile="C:\Temp\yourFile.xlsx"
   dbms=EXCEL
   Replace;
  sheet='Class';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Simply repeat the operation for several sheets&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 16:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-different-Excel-sheets-based-on-variable/m-p/865979#M341987</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2023-03-23T16:10:07Z</dc:date>
    </item>
  </channel>
</rss>

