<?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 How to export sas dataset into multiple tabs in excel? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-export-sas-dataset-into-multiple-tabs-in-excel/m-p/39246#M5437</link>
    <description>I have a dataset containing 50 states and descriptive information for each state.&lt;BR /&gt;
I need to create reports in excel containing 50 tabs , one for each state which contains only information for that particular state.  Is it possible with DDE or ODS Excel tagset?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance,</description>
    <pubDate>Tue, 22 Jun 2010 23:39:03 GMT</pubDate>
    <dc:creator>sasworld</dc:creator>
    <dc:date>2010-06-22T23:39:03Z</dc:date>
    <item>
      <title>How to export sas dataset into multiple tabs in excel?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-export-sas-dataset-into-multiple-tabs-in-excel/m-p/39246#M5437</link>
      <description>I have a dataset containing 50 states and descriptive information for each state.&lt;BR /&gt;
I need to create reports in excel containing 50 tabs , one for each state which contains only information for that particular state.  Is it possible with DDE or ODS Excel tagset?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance,</description>
      <pubDate>Tue, 22 Jun 2010 23:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-export-sas-dataset-into-multiple-tabs-in-excel/m-p/39246#M5437</guid>
      <dc:creator>sasworld</dc:creator>
      <dc:date>2010-06-22T23:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to export sas dataset into multiple tabs in excel?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-export-sas-dataset-into-multiple-tabs-in-excel/m-p/39247#M5438</link>
      <description>Hi:&lt;BR /&gt;
  If you use PROC PRINT, PROC REPORT and/or PROC TABULATE with BY group processing (or other procedures with BY groups or other types of processing, such as the PAGE dimension in TABULATE...), you can generate a sheet for every interval that you specify. With BY group processing, a new sheet for every BY group table is automatic behavior.&lt;BR /&gt;
 &lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sort data=sashelp.class out=class;&lt;BR /&gt;
  by sex name;&lt;BR /&gt;
run;&lt;BR /&gt;
                             &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods tagsets.excelxp file='c:\temp\bygender.xls' style=sasweb;&lt;BR /&gt;
                &lt;BR /&gt;
  proc print data=class noobs;&lt;BR /&gt;
    by sex;&lt;BR /&gt;
    var name age height weight;&lt;BR /&gt;
  run;&lt;BR /&gt;
ods tagsets.excelxp close;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                 &lt;BR /&gt;
Even if you do NOT use ODS TAGSETS.EXCELXP, you can use PROC EXPORT to create multiple sheet in one workbook using the following code (code is shown for SAS 9.1.3 -- creates an XLS file...not an XLSX file):&lt;BR /&gt;
[pre]&lt;BR /&gt;
** Proc Export method to create multiple sheets;&lt;BR /&gt;
                         &lt;BR /&gt;
proc sort data=sashelp.shoes out=Pshoes;&lt;BR /&gt;
where region = 'Pacific';&lt;BR /&gt;
by region subsidiary; &lt;BR /&gt;
run;&lt;BR /&gt;
          &lt;BR /&gt;
proc sort data=sashelp.shoes out=WEshoes;&lt;BR /&gt;
where region = 'Western Europe';&lt;BR /&gt;
by region subsidiary; &lt;BR /&gt;
run;&lt;BR /&gt;
             &lt;BR /&gt;
proc sort data=sashelp.shoes out=Drshoes;&lt;BR /&gt;
where product contains 'Dress';&lt;BR /&gt;
by region subsidiary; &lt;BR /&gt;
run;&lt;BR /&gt;
               &lt;BR /&gt;
proc export data=Pshoes &lt;BR /&gt;
            outfile= "exp_method.xls" &lt;BR /&gt;
            dbms=excel2002 replace;&lt;BR /&gt;
     sheet="Pacific"; &lt;BR /&gt;
run;&lt;BR /&gt;
            &lt;BR /&gt;
proc export data=WEshoes &lt;BR /&gt;
            outfile= "exp_method.xls" &lt;BR /&gt;
            dbms=excel2002 replace;&lt;BR /&gt;
     sheet="West_Eur"; &lt;BR /&gt;
run;&lt;BR /&gt;
            &lt;BR /&gt;
proc export data=DRshoes &lt;BR /&gt;
            outfile= "exp_method.xls" &lt;BR /&gt;
            dbms=excel2002 replace;&lt;BR /&gt;
     sheet="Dressy"; &lt;BR /&gt;
run;&lt;BR /&gt;
                       &lt;BR /&gt;
[/pre]&lt;BR /&gt;
                           &lt;BR /&gt;
You will note that the difference in the outputs is that the TAGSETS.EXCELXP output does use the SASWEB style information; while the PROC EXPORT method results in a set of worksheets that do not have any style information.&lt;BR /&gt;
 &lt;BR /&gt;
For more information about controlling spreadsheet options and suboption with ODS TAGSETS.EXCELXP, refer to this paper:&lt;BR /&gt;
 &lt;A href="http://www.nesug.org/proceedings/nesug08/ap/ap06.pdf" target="_blank"&gt;http://www.nesug.org/proceedings/nesug08/ap/ap06.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 23 Jun 2010 02:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-export-sas-dataset-into-multiple-tabs-in-excel/m-p/39247#M5438</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-06-23T02:18:00Z</dc:date>
    </item>
  </channel>
</rss>

