<?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: Need help to use bygroup option in Proc Report in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347219#M18298</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Well, PROC REPORT or PROC PRINT doesn't matter, what matters is the options and suboptions you use. For example, this code works fine for me to name each sheet with the value of the BY group for that sheet.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
  by age;
  where age in (12, 13, 14);
run;

options nobyline;

ods excel file='c:\temp\bygrp_excel_sheet_title.xlsx' style=htmlblue
    options(sheet_interval='bygroup' sheet_name="Age: #byval1" embedded_titles='yes');
	  
ods tagsets.excelxp file="c:\temp\bygroup_one_sheet_title.xml" style=htmlblue 
    options(sheet_interval='bygroup' sheet_name="Age: #byval1" embedded_titles='yes');
    
    proc report data=class; 
      by age;
	  column name sex age height weight;
	  title 'Report for Age: #byval(age)';
    run;
ods tagsets.excelxp close;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since you did not really provide data nor information about the destination you were using, I just used SASHELP.CLASS and ODS EXCEL and ODS TAGSETS.EXCELXP as proof of concept. You will at least need 9.4 of SAS to run the ODS EXCEL example, but the TAGSETS.EXCELXP example should work in 9.3 as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
    <pubDate>Wed, 05 Apr 2017 03:33:36 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2017-04-05T03:33:36Z</dc:date>
    <item>
      <title>Need help to use bygroup option in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347006#M18285</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I needs to use ODS Tagsets ExcelXP bygroup option in Proc Report. How can I use group option in Proc Report. Please provide me your suggestions.</description>
      <pubDate>Tue, 04 Apr 2017 11:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347006#M18285</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2017-04-04T11:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to use bygroup option in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347013#M18286</link>
      <description>&lt;P&gt;Sorry, you have not really told us anything there. &amp;nbsp;A good question is one that provides test data, in the form of a datastep (or from sashelp tables), and what the output should look like. &amp;nbsp;Also, any code you have done towards it or logic needed.&lt;/P&gt;
&lt;P&gt;From what I can decode from your post you are talking about two different things. &amp;nbsp;By group processing does the whole procedure for each by group, define/group sums just block out and summarise data within the one procedure. &amp;nbsp;Now for by group something like:&lt;/P&gt;
&lt;PRE&gt;ods tagsets.excelxp file="s:\temp\rob\test.xml" options(sheet_interval="bygroup");
proc sort data=sashelp.class out=class;
  by sex;
run;
proc report data=class;
  by sex;
  title '#byval1';
run;
ods tagsets.excelxp close;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Apr 2017 12:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347013#M18286</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-04-04T12:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to use bygroup option in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347034#M18288</link>
      <description>Hi:&lt;BR /&gt;  I believe there have been other forum postings on the use of BYGROUP processing with TAGSETS.EXCELXP -- the proc you use is typically irrelevant. What people usually want is for the #byval to be used for the sheet_name when they have each BY group start on a different sheet and there is a TAGSETS.EXCELXP option for that -- if you put options(doc='Help') in your ODS invocation statement, you'll see the suboption to use. Otherwise, you could search on the forum for previous examples.&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Tue, 04 Apr 2017 13:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347034#M18288</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-04-04T13:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to use bygroup option in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347125#M18294</link>
      <description>Thank you so much RW9 and Cynthia.&lt;BR /&gt;&lt;BR /&gt;Below is my scenario.&lt;BR /&gt;Source:&lt;BR /&gt;&lt;BR /&gt;EmpName Empno Sal DeptName&lt;BR /&gt;100 Santa 1000 Maths&lt;BR /&gt;101 Frank. 2000 Maths&lt;BR /&gt;102 Easter 3000 Science&lt;BR /&gt;103 Quincy. 4000 History&lt;BR /&gt;104 Yesk. 5000 Science&lt;BR /&gt;&lt;BR /&gt;Output:&lt;BR /&gt;&lt;BR /&gt;Excel sheet Name: Class Summary.xlsx&lt;BR /&gt;1st tab: Maths&lt;BR /&gt;&lt;BR /&gt;EmpName Empno DeptName Sal&lt;BR /&gt;100 Santa Maths 1000&lt;BR /&gt;101 Frank Maths 2000&lt;BR /&gt;-----------&lt;BR /&gt;3000&lt;BR /&gt;&lt;BR /&gt;In the same way,Need Excel sheet tabs name should be Department Names. And each tab displays about the each department details.Need all this information in excel sheet.&lt;BR /&gt;&lt;BR /&gt;I got idea on bygroup in ODs tagsets excelxp , and it's easy to use with Proc print. As per my requirement which procedure is suitable to send group information into excel sheet tabs.Thanks for your info.</description>
      <pubDate>Tue, 04 Apr 2017 17:24:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347125#M18294</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2017-04-04T17:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to use bygroup option in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347131#M18295</link>
      <description>&lt;P&gt;Sorry, the question is not clear. &amp;nbsp;Proc report is just a more advanced version of proc print. &amp;nbsp;Wether you use one or the other is up to you. &amp;nbsp;Me, I use proc report for all output. &amp;nbsp;By grouping works on both those, and in fact almost all procedures.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 17:40:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347131#M18295</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-04-04T17:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to use bygroup option in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347219#M18298</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Well, PROC REPORT or PROC PRINT doesn't matter, what matters is the options and suboptions you use. For example, this code works fine for me to name each sheet with the value of the BY group for that sheet.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
  by age;
  where age in (12, 13, 14);
run;

options nobyline;

ods excel file='c:\temp\bygrp_excel_sheet_title.xlsx' style=htmlblue
    options(sheet_interval='bygroup' sheet_name="Age: #byval1" embedded_titles='yes');
	  
ods tagsets.excelxp file="c:\temp\bygroup_one_sheet_title.xml" style=htmlblue 
    options(sheet_interval='bygroup' sheet_name="Age: #byval1" embedded_titles='yes');
    
    proc report data=class; 
      by age;
	  column name sex age height weight;
	  title 'Report for Age: #byval(age)';
    run;
ods tagsets.excelxp close;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since you did not really provide data nor information about the destination you were using, I just used SASHELP.CLASS and ODS EXCEL and ODS TAGSETS.EXCELXP as proof of concept. You will at least need 9.4 of SAS to run the ODS EXCEL example, but the TAGSETS.EXCELXP example should work in 9.3 as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 03:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347219#M18298</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-04-05T03:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to use bygroup option in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347237#M18299</link>
      <description>Thank you so much for all your response. I got the info for what I require.</description>
      <pubDate>Wed, 05 Apr 2017 06:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347237#M18299</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2017-04-05T06:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to use bygroup option in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347869#M18300</link>
      <description>Could you please let me know what is the meaning of&lt;BR /&gt;below default column width option in ods tagsets.excelxp*(Would like to know what's the meaning of all these values)&lt;BR /&gt;&lt;BR /&gt;default_column_width='17.14, 21.57, 17.71, 18.29, 17.29, 15.29, 18.02, 15.86, 16.57, 47.57' width_fudge='0.55');&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Apr 2017 18:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347869#M18300</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2017-04-06T18:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to use bygroup option in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347959#M18301</link>
      <description>Hi:&lt;BR /&gt;  Please add &lt;BR /&gt;options(doc='Help' ... other options) to your ODS TAGSETS.EXCELXP and you can read about the default_column_widths suboption.&lt;BR /&gt; &lt;BR /&gt;cynthia</description>
      <pubDate>Thu, 06 Apr 2017 23:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Need-help-to-use-bygroup-option-in-Proc-Report/m-p/347959#M18301</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-04-06T23:53:25Z</dc:date>
    </item>
  </channel>
</rss>

