<?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 sheet naming with multiple tables from a proc in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-naming-with-multiple-tables-from-a-proc/m-p/367190#M18821</link>
    <description>&lt;P&gt;This is a way to do it without using PROC DOCUMENT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
	set sashelp.class;
	drop name;
run;

ods excel file="e:\temp\test.xlsx" options(sheet_name="test" sheet_interval="proc");

proc print data=sashelp.class;
run;

ods excel options(sheet_name="Compare Datasets" sheet_interval="table");

ods select compareDatasets;
title1 "STEP 1: Compare contents of files";

proc compare base=sashelp.class compare=class listvar novalues;
run;

ods excel options(sheet_name="Compare Variables");

ods select compareVariables;

proc compare base=sashelp.class compare=class listvar novalues;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 15 Jun 2017 00:33:28 GMT</pubDate>
    <dc:creator>SuzanneDorinski</dc:creator>
    <dc:date>2017-06-15T00:33:28Z</dc:date>
    <item>
      <title>ODS EXCEL sheet naming with multiple tables from a proc</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-naming-with-multiple-tables-from-a-proc/m-p/366783#M18814</link>
      <description>&lt;P&gt;I'm trying to&amp;nbsp;use ODS EXCEL to do the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. &amp;nbsp;Print something, and put that on a sheet named something specific.&lt;/P&gt;
&lt;P&gt;2. &amp;nbsp;Run a PROC COMPARE, and make two sheets, the main Dataset sheet and the Variables comparison, and name them something intelligent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either of these is not a problem separately; I like the&amp;nbsp;automatic names you get from SAS by default for 2, and for 1 I know how to use SHEET_NAME. &amp;nbsp;But when I do them - in this order - it fails.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
  set sashelp.class;
  drop name;
run;

ods excel file="e:\temp\test.xlsx" options(sheet_name="test" sheet_interval="table");
proc print data=sashelp.class;
run;
ods exclude compareSummary;
title1 "STEP 1: Compare contents of files";  
proc compare base=sashelp.class compare=class listvar novalues ;
run;
ods excel close;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I end up with "test 2" and "test 3" as sheet names, which is no good. &amp;nbsp;I can use&lt;/P&gt;
&lt;PRE&gt;options(sheet_name=' ')&lt;/PRE&gt;
&lt;P&gt;and get "Sheet 1" and "Sheet 2", which is not really that much better. &amp;nbsp;If I use Sheet_Label I&amp;nbsp;don't get much better; obviously something sees that sheet_name has _ever_ been set, and refuses to forget that it was.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a workaround using PROC DOCUMENT that works fine, but I'm curious if&amp;nbsp;there's a more integrated way to do this. &amp;nbsp;Something like ODS PROCLABEL but for the tables maybe?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
  set sashelp.class;
  drop name;
run;

ods excel file="e:\temp\test.xlsx" options(sheet_name="test" sheet_interval="table");
proc print data=sashelp.class;
run;

ods document name=conts;
ods exclude compareSummary;
ods excel exclude all;
title1 "STEP 1: Compare contents of files";  
proc compare base=sashelp.class compare=class listvar novalues ;
run;
ods document close;&lt;BR /&gt;ods exclude none;

proc document name=conts;
ods excel options(sheet_name="Compare Datasets");
replay \Compare#1\CompareDatasets#1;
run;
ods excel options(sheet_name="Compare Variables");
replay \Compare#1\CompareVariables#1;
run;
quit;

ods excel close;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Jun 2017 22:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-naming-with-multiple-tables-from-a-proc/m-p/366783#M18814</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2017-06-13T22:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: ODS EXCEL sheet naming with multiple tables from a proc</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-naming-with-multiple-tables-from-a-proc/m-p/366796#M18815</link>
      <description>&lt;P&gt;See if this gives you a hint:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods excel file="e:\temp\test.xlsx" 
    options(sheet_name="Print" sheet_interval="table");
proc print data=sashelp.class;
run;
ods exclude compareSummary;
ods excel options(sheet_name="Compare" );
title1 "STEP 1: Compare contents of files";  
proc compare base=sashelp.class compare=class listvar novalues ;
run;
ods excel close;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Jun 2017 23:34:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-naming-with-multiple-tables-from-a-proc/m-p/366796#M18815</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-13T23:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: ODS EXCEL sheet naming with multiple tables from a proc</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-naming-with-multiple-tables-from-a-proc/m-p/367000#M18819</link>
      <description>&lt;P&gt;Not sure what it's supposed to be hinting at? &amp;nbsp;That produces "Compare" and "Compare 2" as sheet names, which isn't what I want; I want to individually name those two tabs.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 15:28:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-naming-with-multiple-tables-from-a-proc/m-p/367000#M18819</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2017-06-14T15:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: ODS EXCEL sheet naming with multiple tables from a proc</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-naming-with-multiple-tables-from-a-proc/m-p/367190#M18821</link>
      <description>&lt;P&gt;This is a way to do it without using PROC DOCUMENT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
	set sashelp.class;
	drop name;
run;

ods excel file="e:\temp\test.xlsx" options(sheet_name="test" sheet_interval="proc");

proc print data=sashelp.class;
run;

ods excel options(sheet_name="Compare Datasets" sheet_interval="table");

ods select compareDatasets;
title1 "STEP 1: Compare contents of files";

proc compare base=sashelp.class compare=class listvar novalues;
run;

ods excel options(sheet_name="Compare Variables");

ods select compareVariables;

proc compare base=sashelp.class compare=class listvar novalues;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Jun 2017 00:33:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-naming-with-multiple-tables-from-a-proc/m-p/367190#M18821</guid>
      <dc:creator>SuzanneDorinski</dc:creator>
      <dc:date>2017-06-15T00:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: ODS EXCEL sheet naming with multiple tables from a proc</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-naming-with-multiple-tables-from-a-proc/m-p/367375#M18822</link>
      <description>&lt;P&gt;Thanks - that was a consideration as well, trying to avoid two PROC COMPAREs of course but since we're not doing value comparisons it's not exactly expensive. &amp;nbsp;Thanks for the suggestion!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 14:09:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-naming-with-multiple-tables-from-a-proc/m-p/367375#M18822</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2017-06-15T14:09:07Z</dc:date>
    </item>
  </channel>
</rss>

