<?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: ods excel -multiple sheets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536452#M147428</link>
    <description>&lt;P&gt;I run this code and still dont get expected result.&lt;/P&gt;
&lt;P&gt;In this result each table appear in a different sheet but I want that table+table2 will be in sheet one.&lt;/P&gt;
&lt;P&gt;Tables 3 will be in sheet two&lt;/P&gt;
&lt;P&gt;Table4 will be in sheet 4&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="/path/Ex7.XLSX" 
    options(sheet_name="one" );
	/*Sheet one*/
	Title 'Table1';
	proc print data=sashelp.class(obs=3) noobs;
	run;
	Title 'Table2';
	proc print data=sashelp.shoes(obs=3) noobs;
	run;
ods excel options(sheet_name="two" );
	/*Sheet two*/
	Title 'Tables3';
  proc report data=sashelp.prdsale;
    column country region actual predict;
	define country / group page;
	define region / group;
	break after country / summarize page;
  run;
ods excel options(sheet_name="three" );
	/*Sheet three*/
  Title 'Table4';
  proc print data=sashelp.heart(obs=10) noobs;
  run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 18 Feb 2019 12:29:46 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2019-02-18T12:29:46Z</dc:date>
    <item>
      <title>ods excel -multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536399#M147406</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am using ODS excel to export multiple tables to multiple sheets in one excel file.&lt;/P&gt;
&lt;P&gt;I want to create 3 sheets: "one" &amp;nbsp;"two" &amp;nbsp; "three".&lt;/P&gt;
&lt;P&gt;In the result I get only one sheet.&lt;/P&gt;
&lt;P&gt;What is wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="/path/Ex3.XLSX" 
    options(sheet_name="one" sheet_interval='none');
	/*Sheet one*/
	Title 'Table1';
	proc print data=sashelp.class(obs=3) noobs;
	run;
	Title 'Table2';
	proc print data=sashelp.shoes(obs=3) noobs;
	run;
ods excel options(sheet_name="two" sheet_interval='none');
	/*Sheet two*/
	Title 'Tables3';
  proc report data=sashelp.prdsale;
    column country region actual predict;
	define country / group page;
	define region / group;
	break after country / summarize page;
  run;
ods excel options(sheet_name="three" sheet_interval='none');
	/*Sheet three*/
  Title 'Table4';
  proc print data=sashelp.heart(obs=10) noobs;
  run;
ods excel close;
  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 09:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536399#M147406</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-02-18T09:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel -multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536400#M147407</link>
      <description>&lt;P&gt;You have told it not to use multiple sheets with:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;sheet_interval&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'none'&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 09:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536400#M147407</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-18T09:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel -multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536452#M147428</link>
      <description>&lt;P&gt;I run this code and still dont get expected result.&lt;/P&gt;
&lt;P&gt;In this result each table appear in a different sheet but I want that table+table2 will be in sheet one.&lt;/P&gt;
&lt;P&gt;Tables 3 will be in sheet two&lt;/P&gt;
&lt;P&gt;Table4 will be in sheet 4&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="/path/Ex7.XLSX" 
    options(sheet_name="one" );
	/*Sheet one*/
	Title 'Table1';
	proc print data=sashelp.class(obs=3) noobs;
	run;
	Title 'Table2';
	proc print data=sashelp.shoes(obs=3) noobs;
	run;
ods excel options(sheet_name="two" );
	/*Sheet two*/
	Title 'Tables3';
  proc report data=sashelp.prdsale;
    column country region actual predict;
	define country / group page;
	define region / group;
	break after country / summarize page;
  run;
ods excel options(sheet_name="three" );
	/*Sheet three*/
  Title 'Table4';
  proc print data=sashelp.heart(obs=10) noobs;
  run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Feb 2019 12:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536452#M147428</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-02-18T12:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel -multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536454#M147430</link>
      <description>&lt;P&gt;Have you tried setting the option at the right moment:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;ods&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;excel&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;file&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"/path/Ex7.XLSX"&lt;/SPAN&gt; 
    &lt;SPAN class="token procnames"&gt;options&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;sheet_name&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"one"&lt;/SPAN&gt; sheet_interval="none"&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token comment"&gt;/*Sheet one*/&lt;/SPAN&gt;
	&lt;SPAN class="token statement"&gt;Title&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Table1'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;print&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;sashelp&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;class&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;obs&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; noobs&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token statement"&gt;Title&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Table2'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;print&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;sashelp&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;shoes&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;obs&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; noobs&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;ods&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;excel&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;options&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;sheet_name&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"two"&lt;/SPAN&gt; sheet_interval="table"&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token comment"&gt;/*Sheet two*/&lt;/SPAN&gt;
	&lt;SPAN class="token statement"&gt;Title&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Tables3'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;report&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;sashelp&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;prdsale&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token keyword"&gt;column&lt;/SPAN&gt; country region actual predict&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;define&lt;/SPAN&gt; country &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;group&lt;/SPAN&gt; page&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;define&lt;/SPAN&gt; region &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;group&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;break&lt;/SPAN&gt; after country &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; summarize page&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;ods&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;excel&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;options&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;sheet_name&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"three"&lt;/SPAN&gt; sheet_interval="table"&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token comment"&gt;/*Sheet three*/&lt;/SPAN&gt;
  &lt;SPAN class="token statement"&gt;Title&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Table4'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;print&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;sashelp&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;heart&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;obs&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;10&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; noobs&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;ods&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;excel&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;close&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Feb 2019 12:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536454#M147430</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-18T12:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel -multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536646#M147492</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;
&lt;P&gt;However, the result of the code that you sent is not giving the desired result.&lt;/P&gt;
&lt;P&gt;In this code there are 3 sheets :two &amp;nbsp;&amp;nbsp;two2 &amp;nbsp;two3 &amp;nbsp;and I want to create one sheet called "two" with 3 tables (from proc report)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 04:35:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536646#M147492</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-02-19T04:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel -multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536648#M147494</link>
      <description>&lt;P&gt;I found the solution.&lt;/P&gt;
&lt;P&gt;Need to use a dummy table.&lt;/P&gt;
&lt;P&gt;I really dont know what this code is doing but it solve the problem and get the desired result&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="/path/Ex7.XLSX"
    options(sheet_name="Sh1" sheet_interval="none");
/*Sheet1-2 tables*/
	Title 'Table1';
	proc print data=sashelp.class(obs=3) noobs;
	run;
	Title 'Table2';
	proc print data=sashelp.shoes(obs=3) noobs;
	run;
/*Sheet2-multiple tables created by proc report*/
/*Add dummy table */
ods excel options(sheet_interval="table");
ods exclude all;
data _null_;
file print;
put _all_;
run;
ods select all;
ods excel options(sheet_name="Sh2"  sheet_interval="none");
  proc report data=sashelp.prdsale;
    column country region actual predict;
	define country / group page;
	define region / group;
	break after country / summarize page;
  run;
 /*Sheet3-one table*/
/*Add dummy table */
ods excel options(sheet_interval="table");
ods exclude all;
data _null_;
file print;
put _all_;
run;
ods select all;
ods excel options(sheet_name="Sh3"  sheet_interval="none");
  proc print data=sashelp.heart(obs=10) noobs;
  run;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Feb 2019 05:08:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536648#M147494</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-02-19T05:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel -multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536670#M147503</link>
      <description>&lt;P&gt;The code I presented works perfectly well:&lt;/P&gt;
&lt;PRE&gt;ods excel file="&amp;amp;_sasws_./test.xlsx" options(sheet_name="Sh1" sheet_interval="none");
title 'Table1';
proc print data=sashelp.class(obs=3) noobs;
run;
title 'Table2';
proc print data=sashelp.shoes(obs=3) noobs;
run;
ods excel options(sheet_interval="table");
proc print data=sashelp.cars;
run;
ods excel close;&lt;/PRE&gt;
&lt;P&gt;This will print class and shoes to sh1, and cars to sh2 - it is tested working.&amp;nbsp; Your "Correct" post, does nothing further than what I present here!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 08:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536670#M147503</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-19T08:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel -multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536674#M147507</link>
      <description>&lt;P&gt;Can you also Add the proc report output to another sheet and check if you get it in one sheet?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; proc report data=sashelp.prdsale;
    column country region actual predict;
	define country / group page;
	define region / group;
	break after country / summarize page;
  run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Feb 2019 09:06:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536674#M147507</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-02-19T09:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel -multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536676#M147509</link>
      <description>&lt;P&gt;When I run this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods excel file="&amp;amp;_sasws_./test.xlsx" options(sheet_name="Sh1" sheet_interval="none");
title 'Table1';
proc print data=sashelp.class(obs=3) noobs;
run;
title 'Table2';
proc print data=sashelp.shoes(obs=3) noobs;
run;
ods excel options(sheet_interval="table");
proc print data=sashelp.cars;
run;
proc report data=sashelp.prdsale;
    column country region actual predict;
   define country / group page;
   define region / group;
   break after country / summarize page;
  run;

ods excel close;&lt;/PRE&gt;
&lt;P&gt;I get tabs for Sh1 1 = Class and Shoes,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sh1 2 = Cars&lt;/P&gt;
&lt;P&gt;SH1 3-5 = the three summarised tables from the proc report, each on their own tab as three component tables are created - as clearly programmed to do this by the statement:&lt;/P&gt;
&lt;PRE&gt;   break after country / summarize page;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 09:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-excel-multiple-sheets/m-p/536676#M147509</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-19T09:10:16Z</dc:date>
    </item>
  </channel>
</rss>

