<?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: proc report, subtotal when using group/noprint in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124713#M34255</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ou. You have changed the age from numeric to character.&lt;/P&gt;&lt;P&gt;If you allow this transformation ,that would very easy. I think you can do it better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data test;
set sashelp.class;
age_text = put(age,10.);
run;

ods listing close ;
ods html file='c:\x.html';
options missing=' ';
proc report data=test nowd out=x;
column sex age_text height;
define sex / group noprint ;
define age_text / group missing ;
define height / analysis SUM ;
compute before sex ;
&amp;nbsp; age_text = sex;call missing(height.sum);
endcomp;
compute after sex;
&amp;nbsp; age_text = catx(' ',"subtotal",sex);
endcomp;
compute after ;
&amp;nbsp; age_text = "total";
endcomp;
break before sex / summarize ;
break after sex / summarize ;
rbreak after / summarize;
run;
Run ;
ods html close; 
ods listing;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 May 2012 11:38:48 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2012-05-25T11:38:48Z</dc:date>
    <item>
      <title>proc report, subtotal when using group/noprint</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124710#M34252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I display a text "Subtotal of [sex]" in the age column in this example;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods listing close ;&lt;/P&gt;&lt;P&gt;ods html;&lt;/P&gt;&lt;P&gt;proc report data=sashelp.class nowd;&lt;/P&gt;&lt;P&gt;&amp;nbsp; column sex age height;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define sex / group&amp;nbsp; noprint ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; compute before sex / style=[just=l fontweight=bold];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text1=sex;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; line text1 $;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define age / group&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; compute age;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _break_='_RBREAK_' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define("age", 'style', 'style=[pretext="Total "]');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define height / analysis SUM ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; break after sex / summarize ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; rbreak after / summarize;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;ods html close; Run ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 12:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124710#M34252</guid>
      <dc:creator>SandSand</dc:creator>
      <dc:date>2012-05-23T12:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: proc report, subtotal when using group/noprint</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124711#M34253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;ods listing close ;
ods html;
proc report data=sashelp.class nowd;
&amp;nbsp; column sex age height;
&amp;nbsp; define sex / group&amp;nbsp; noprint ;
&amp;nbsp; compute after sex / style=[just=l fontweight=bold];
&amp;nbsp;&amp;nbsp;&amp;nbsp; text1='Subtotal of '||sex;
&amp;nbsp;&amp;nbsp;&amp;nbsp; line text1 $34. height.sum best10.;
&amp;nbsp; endcomp;
&amp;nbsp; compute after /style=[just=l fontweight=bold];
&amp;nbsp;&amp;nbsp;&amp;nbsp; text2='Total';
&amp;nbsp;&amp;nbsp;&amp;nbsp; line text2 $40. height.sum best10.;
&amp;nbsp; endcomp;
&amp;nbsp; define age / group&amp;nbsp; ;
&amp;nbsp; compute age;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _break_='_RBREAK_' then do;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define("age", 'style', 'style=[pretext="Total "]');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;
&amp;nbsp; endcomp;
&amp;nbsp; define height / analysis SUM ;
&amp;nbsp; run;

ods html close; 

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 09:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124711#M34253</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-05-24T09:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: proc report, subtotal when using group/noprint</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124712#M34254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ksharp, thanks. Didn't seem to work as I wanted though. But found out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set sashelp.class;&lt;/P&gt;&lt;P&gt;age_text = put(age,10.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods listing close ;&lt;/P&gt;&lt;P&gt;ods html;&lt;/P&gt;&lt;P&gt;proc report data=test nowd;&lt;/P&gt;&lt;P&gt; column sex age_text height;&lt;/P&gt;&lt;P&gt; define sex / group noprint ;&lt;/P&gt;&lt;P&gt; compute before sex / style=[just=l fontweight=bold];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text1=sex;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; line text1 $;&lt;/P&gt;&lt;P&gt; endcomp;&lt;/P&gt;&lt;P&gt; define age_text / group missing ;&lt;/P&gt;&lt;P&gt; define height / analysis SUM ;&lt;/P&gt;&lt;P&gt; break after sex / summarize ;&lt;/P&gt;&lt;P&gt; compute after sex;&lt;/P&gt;&lt;P&gt;&amp;nbsp; age_text = "subtotal";&lt;/P&gt;&lt;P&gt; endcomp;&lt;/P&gt;&lt;P&gt; rbreak after / summarize;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;ods html close; Run ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 08:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124712#M34254</guid>
      <dc:creator>SandSand</dc:creator>
      <dc:date>2012-05-25T08:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: proc report, subtotal when using group/noprint</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124713#M34255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ou. You have changed the age from numeric to character.&lt;/P&gt;&lt;P&gt;If you allow this transformation ,that would very easy. I think you can do it better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data test;
set sashelp.class;
age_text = put(age,10.);
run;

ods listing close ;
ods html file='c:\x.html';
options missing=' ';
proc report data=test nowd out=x;
column sex age_text height;
define sex / group noprint ;
define age_text / group missing ;
define height / analysis SUM ;
compute before sex ;
&amp;nbsp; age_text = sex;call missing(height.sum);
endcomp;
compute after sex;
&amp;nbsp; age_text = catx(' ',"subtotal",sex);
endcomp;
compute after ;
&amp;nbsp; age_text = "total";
endcomp;
break before sex / summarize ;
break after sex / summarize ;
rbreak after / summarize;
run;
Run ;
ods html close; 
ods listing;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 11:38:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124713#M34255</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-05-25T11:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: proc report, subtotal when using group/noprint</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124714#M34256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks ! That also works as intended.&lt;/P&gt;&lt;P&gt;Br.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 13:13:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124714#M34256</guid>
      <dc:creator>SandSand</dc:creator>
      <dc:date>2012-05-25T13:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: proc report, subtotal when using group/noprint</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124715#M34257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Another alternative is to use your PRETEXT technique for the report break and&amp;nbsp; as for the other breaks. The only difference is that you need to build your style= override string into a variable for the CALL DEFINE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods listing close ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG style="font-family: courier new,courier;"&gt;ods html file='c:\temp\something.html' style=sasweb;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc report data=sashelp.class nowd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; column sex age height;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define sex / group&amp;nbsp; noprint ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define age / group&amp;nbsp; style(column)={cellwidth=1in};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define height / analysis SUM ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; break after sex / summarize ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; rbreak after / summarize;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; compute before sex / style=[just=l fontweight=bold];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text1=sex;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; line text1 $5.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; compute age;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length pt $20 sstr $50 text1 $1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _break_='_RBREAK_' then do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define("age", 'style', 'style=[pretext="Total "]');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if upcase(_break_) = 'SEX' then do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pt= catx(' ', 'Subtotal of',text1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sstr = 'style=[pretext="'||trim(pt)||'"]';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ** use temporary variable for value of style override;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define("age", 'style', sstr);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html close;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 May 2012 00:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-subtotal-when-using-group-noprint/m-p/124715#M34257</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-05-26T00:03:11Z</dc:date>
    </item>
  </channel>
</rss>

