<?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  for multiple sheet in one excel file with ODS excel &amp;amp; text in PROC Report in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-for-multiple-sheet-in-one-excel-file-with-ODS-excel/m-p/656306#M24191</link>
    <description>&lt;P&gt;Change your ODS statements like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel
  file="%sysfunc(pathname(out))/Gender Listings.xlsx" 
  options(sheet_name="sheet1" sheet_interval="none")
;

proc odstext; 
   p "This is Male data" 
     / style={background=yellow tagattr="mergeacross:6"}; run;
run;

proc Report data=sheet1 split='^';
  column Name Sex Height Age Weight ;
  define col1 / 'Name' display;
  define col2 / 'Sex' display;
  define col3 / 'Age' display;   
  define col4 / 'Height' display;
  define col5 / 'Weight' display;
run;

ods excel
  options(sheet_name="sheet2")
;

proc odstext; 
   p "This is Female data" 
     / style={background=yellow tagattr="mergeacross:6"}; run;
run;

proc Report data=sheet2 split='^';
  column Name Sex Height Age Weight ;
  define col1 / 'Name' display;
  define col2 / 'Sex' display;
  define col3 / 'Age' display;   
  define col4 / 'Height' display;
  define col5 / 'Weight' display;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Jun 2020 09:44:02 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-06-10T09:44:02Z</dc:date>
    <item>
      <title>ODS Excel  for multiple sheet in one excel file with ODS excel &amp; text in PROC Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-for-multiple-sheet-in-one-excel-file-with-ODS-excel/m-p/656240#M24190</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have search many questions in this community , but i couldn't find the solution for my problem&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;have to&amp;nbsp; generate one excel file with multiple sheet include title in every sheet,&lt;/P&gt;&lt;P&gt;I need to generate by using only&lt;U&gt; ODS excel with proc report&lt;/U&gt; , but with below code i am getting last sheet only&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sheet1;
 set sashelp.class;
 if sex eq 'M';
run;

data sheet2;
 set sashelp.class;
 if sex eq 'F';
run;


ods excel  file="%sysfunc(pathname(out))/Gender Listings.xlsx" 
 options(sheet_name="sheet1" sheet_interval="none");
 proc odstext; 
   p "This is Male data" 
     / style={background=yellow tagattr="mergeacross:6"}; run;
run;
proc Report data=sheet1 split='^';
  column Name Sex Height Age Weight ;
  define col1 /'Name'                                                               display;
  define col2 / 'Sex'                                      display;
  define col3 / 'Age' display;   
  define col4 / 'Height'                    display;
  define col5 / 'Weight'                      display;

run;
ods excel close;
ods _all_ close;
ods listing;


ods excel  file="%sysfunc(pathname(out))/Gender Listings.xlsx" 
options(sheet_name="sheet2" sheet_interval="none");
 proc odstext; 
   p "This is Female data" 
     / style={background=yellow tagattr="mergeacross:6"}; run;
run;
proc Report data=sheet2 split='^';
  column Name Sex Height Age Weight ;
  define col1 /'Name'                                                               display;
  define col2 / 'Sex'                                      display;
  define col3 / 'Age' display;   
  define col4 / 'Height'                    display;
  define col5 / 'Weight'                      display;

run;
ods excel close;
ods _all_ close;
ods listing;



&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;when i remove ods clear between the code for generate sheet i am getting below error.&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;I need below output excel two sheets in one excel file ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 162px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/42056i041CF653ED27DF78/image-size/small?v=v2&amp;amp;px=200" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 130px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/42055i30963705DD34133C/image-size/small?v=v2&amp;amp;px=200" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 08:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-for-multiple-sheet-in-one-excel-file-with-ODS-excel/m-p/656240#M24190</guid>
      <dc:creator>raja777pharma</dc:creator>
      <dc:date>2020-06-10T08:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel  for multiple sheet in one excel file with ODS excel &amp; text in PROC Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-for-multiple-sheet-in-one-excel-file-with-ODS-excel/m-p/656306#M24191</link>
      <description>&lt;P&gt;Change your ODS statements like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel
  file="%sysfunc(pathname(out))/Gender Listings.xlsx" 
  options(sheet_name="sheet1" sheet_interval="none")
;

proc odstext; 
   p "This is Male data" 
     / style={background=yellow tagattr="mergeacross:6"}; run;
run;

proc Report data=sheet1 split='^';
  column Name Sex Height Age Weight ;
  define col1 / 'Name' display;
  define col2 / 'Sex' display;
  define col3 / 'Age' display;   
  define col4 / 'Height' display;
  define col5 / 'Weight' display;
run;

ods excel
  options(sheet_name="sheet2")
;

proc odstext; 
   p "This is Female data" 
     / style={background=yellow tagattr="mergeacross:6"}; run;
run;

proc Report data=sheet2 split='^';
  column Name Sex Height Age Weight ;
  define col1 / 'Name' display;
  define col2 / 'Sex' display;
  define col3 / 'Age' display;   
  define col4 / 'Height' display;
  define col5 / 'Weight' display;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jun 2020 09:44:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Excel-for-multiple-sheet-in-one-excel-file-with-ODS-excel/m-p/656306#M24191</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-10T09:44:02Z</dc:date>
    </item>
  </channel>
</rss>

