<?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 Does excel destination use only one by variable with the sheet_interval='bygroup' option? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396008#M19348</link>
    <description>&lt;P&gt;Good morning,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am playing around with generating multiple tabs in a spreadsheet when using multiple by variables.&amp;nbsp; 9.4M4 version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Running the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods excel file="c:\temp\sh.xlsx" options(sheet_interval="bygroup" sheet_name='none');&lt;BR /&gt;proc report data=sashelp.shoes;&lt;BR /&gt;&amp;nbsp; by region subsidiary ;&lt;BR /&gt;&amp;nbsp; column product stores sales;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;ods excel close;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The region comes out on the tab but not the subsidiary.&amp;nbsp; Does it only handle one by variable?&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;P&gt;--Ben&lt;/P&gt;</description>
    <pubDate>Thu, 14 Sep 2017 16:50:53 GMT</pubDate>
    <dc:creator>BenConner</dc:creator>
    <dc:date>2017-09-14T16:50:53Z</dc:date>
    <item>
      <title>Does excel destination use only one by variable with the sheet_interval='bygroup' option?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396008#M19348</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am playing around with generating multiple tabs in a spreadsheet when using multiple by variables.&amp;nbsp; 9.4M4 version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Running the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods excel file="c:\temp\sh.xlsx" options(sheet_interval="bygroup" sheet_name='none');&lt;BR /&gt;proc report data=sashelp.shoes;&lt;BR /&gt;&amp;nbsp; by region subsidiary ;&lt;BR /&gt;&amp;nbsp; column product stores sales;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;ods excel close;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The region comes out on the tab but not the subsidiary.&amp;nbsp; Does it only handle one by variable?&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;P&gt;--Ben&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 16:50:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396008#M19348</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2017-09-14T16:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Does excel destination use only one by variable with the sheet_interval='bygroup' option?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396339#M19355</link>
      <description>&lt;PRE&gt;
Try this one .




options nobyline;
ods excel file="c:\temp\sh.xlsx" options(sheet_interval="bygroup" sheet_name='#byval1 #byval2');
proc report data=sashelp.shoes;
  by region subsidiary ;
  column product stores sales;
run;
ods excel close;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Sep 2017 14:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396339#M19355</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-09-15T14:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Does excel destination use only one by variable with the sheet_interval='bygroup' option?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396391#M19356</link>
      <description>&lt;P&gt;I had tried that approach initially;&amp;nbsp; if you look at the output, you will see the first tab is named 'Africa Addis Ababa'.&amp;nbsp; Based on the sample data, the next one should be called 'Africa Algiers'.&amp;nbsp; Instead it picks up the 2nd region instead with the 1st subsidiary as the next part of the tab's name.&amp;nbsp; And each tab has all the subsidiaries on it for that region.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was hoping it would split out the tabs by region/subsidiary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course the obvious workaround is to create a temp variable with the values concatenated together and use that.&amp;nbsp; Gets a bit awkward though if the variables are not all the same type (character &amp;amp; numeric).&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;P&gt;--Ben&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 15:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396391#M19356</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2017-09-15T15:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Does excel destination use only one by variable with the sheet_interval='bygroup' option?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396511#M19363</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I wasn't sure that this would work, but it did:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
by sex age;
run;
  
options nobyline;
ods excel file="c:\temp\test_bygrp.xlsx" 
    options(sheet_interval="table" sheet_name='#byval1 #byval2');
proc report data=class;
  by sex age ;
  column name sex age height weight;
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;here's the output on one of the sheets but you can see the tabs:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="byvars_mult_shet.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15223iE34D3F2B65FA1104/image-size/large?v=v2&amp;amp;px=999" role="button" title="byvars_mult_shet.png" alt="byvars_mult_shet.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 22:58:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396511#M19363</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-09-15T22:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Does excel destination use only one by variable with the sheet_interval='bygroup' option?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396926#M19371</link>
      <description>&lt;P&gt;Hi Cynthia,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Interesting.&amp;nbsp; that approach does work.&amp;nbsp; Unfortunately the "table" option prevents multiple tables with the same by values from appearing on the same page (say having 2 procs generating output).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The docs on bygroup seem to suggest it should work with the sheet_interval you used.&amp;nbsp; Should I loop T.S. into this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Ben&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 19:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396926#M19371</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2017-09-18T19:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Does excel destination use only one by variable with the sheet_interval='bygroup' option?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396979#M19373</link>
      <description>Hi, Ben:&lt;BR /&gt;  Probably so, I did not understand the requirement to have multiple procedures on the same sheet -- but I don't think that BY group processing. This previous post explains needing a dummy table to "reset" ODS EXCEL so you can use NONE for sheet_interval with multiple outputs on multiple sheets, but the example might not be completely relevant -- since they are not using BY group processing and I assume that both of your steps will have BY group processing?&lt;BR /&gt;&lt;BR /&gt;  My suspicion is you might have to "macroize" your code to mimic by group processing for each procedure.&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Mon, 18 Sep 2017 21:34:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/396979#M19373</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-09-18T21:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Does excel destination use only one by variable with the sheet_interval='bygroup' option?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/403356#M19586</link>
      <description>&lt;P&gt;Hi Cynthia,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for the delay; apparently the root cause of the issue I was having is that Excel has a 31 character length limit on tab names, and SAS reserves a few of those, shrinking it down to somewhere around 28.&amp;nbsp; The data I had in the BY statement creating these things was at times exceeding this.&amp;nbsp; The warning system advising of this condition is apparently stealth mode. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Vince gave his ODS Excel Part 2 talk to the ValSUG group recently where I brought up this problem and it got resolved in a much cleaner way, with a pretty ToC page and much shorter tab names.&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;P&gt;--Ben&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 20:28:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Does-excel-destination-use-only-one-by-variable-with-the-sheet/m-p/403356#M19586</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2017-10-11T20:28:53Z</dc:date>
    </item>
  </channel>
</rss>

