<?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 - Conditional Subtotal? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208213#M13810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Correct, your code doesn't really work.&amp;nbsp; It suppresses the 1st line only.&amp;nbsp; If sex for Tiki = 'T', the counter doesn't work.&amp;nbsp; If there's another "single" entry later on, it doesn't work.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Mar 2015 15:19:11 GMT</pubDate>
    <dc:creator>wcp_fnfg</dc:creator>
    <dc:date>2015-03-25T15:19:11Z</dc:date>
    <item>
      <title>Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208201#M13798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working with proc report, I want to only create a subtotal line IFF the group has more than one observation.&amp;nbsp; I don't want to have a single entry group repeated twice...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some test data:&lt;/P&gt;&lt;P&gt;data tiki;&lt;/P&gt;&lt;P&gt;name='Tiki';&lt;/P&gt;&lt;P&gt;sex='C';&lt;/P&gt;&lt;P&gt;age=10;&lt;/P&gt;&lt;P&gt;height=6;&lt;/P&gt;&lt;P&gt;weight=9.5;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set sashelp.class tiki;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally, I'd get Tiki (Tiki is my cat..) then Subtotal for sex='C'.&amp;nbsp; I want to check if there's more than one obs in that group before I output the subtotal...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need something like if obs &amp;gt; 1 then break, if new group then reset obs to 1...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 16:49:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208201#M13798</guid>
      <dc:creator>wcp_fnfg</dc:creator>
      <dc:date>2015-03-23T16:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208202#M13799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want this code, but without the Subtotal C row.&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;&lt;P&gt;proc report data=WORK.TEST nowd;&lt;/P&gt;&lt;P&gt;&amp;nbsp; column Sex Name Weight;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define Sex / group 'Sex' missing;&lt;/P&gt;&lt;P&gt;&amp;nbsp; compute Sex;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if Sex ne ' ' then hold1=Sex;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if Sex eq ' ' and _break_ eq ' ' then Sex=hold1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if upcase(_break_)="SEX" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call define("Sex", 'style', 'style=[pretext="Subtotal "]');&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _break_='_RBREAK_' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call define("Sex", 'style', 'style=[pretext="Total"]');&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define Name / group 'Name' missing;&lt;/P&gt;&lt;P&gt;&amp;nbsp; compute Name;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _break_ eq ' ' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if Name ne ' ' then hold2=Name;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define Weight / analysis SUM 'Weight' missing;&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;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 17:03:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208202#M13799</guid>
      <dc:creator>wcp_fnfg</dc:creator>
      <dc:date>2015-03-23T17:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208203#M13800</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; PROC REPORT will not allow you to suppress a BREAK line even if you only have 1 observation in the group. The detail lines are written and then the BREAK line is written. The BREAK line cannot be written conditionally. You can always pre-summarize the data, determine which groups will only have 1 observation and then pass the pre-summarized data to PROC REPORT or use PROC REPORT to do the normal report and then pass the first report for post processing and delete the break lines where the count of detail rows on the report is just 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2015 01:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208203#M13800</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-03-24T01:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208204#M13801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still not entirely convinced that this is 100% true.&amp;nbsp; I agree, there's no way to do if X then break after, etc.&amp;nbsp; But inside of a compute block, I still have hope.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an aside, any thoughts on using a computed variable as a "where" for the output?&amp;nbsp; Similar to "where calculated X" in a proc sql;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2015 16:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208204#M13801</guid>
      <dc:creator>wcp_fnfg</dc:creator>
      <dc:date>2015-03-24T16:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208205#M13802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not quite sure . But I think you can get it by VARYING. format. All you need is to post the sample data and what kind of output you need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 13:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208205#M13802</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-25T13:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208206#M13803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can see the desired output and sample data in the OP and first reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 13:53:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208206#M13803</guid>
      <dc:creator>wcp_fnfg</dc:creator>
      <dc:date>2015-03-25T13:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208207#M13804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK. Here is .never thought you are just OP . But you need to adjust the style of LINE on your own .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
data tiki;
name='Tiki';
sex='C';
age=10;
height=6;
weight=9.5;
run;
 
data test;
set sashelp.class tiki;
run;

 
proc report data=WORK.TEST nowd out=x;
&amp;nbsp; column Sex Name Weight;
&amp;nbsp; define Sex / group 'Sex' ;
&amp;nbsp; define Name / group 'Name' ;
&amp;nbsp; define Weight / analysis&amp;nbsp; 'Weight' ;
&amp;nbsp; compute weight;
&amp;nbsp;&amp;nbsp; if _break_='Sex' and Sex='C' then len=0;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else len=40;
&amp;nbsp; endcomp;
&amp;nbsp; compute after Sex /style(lines)={just=r asis=on} ;
&amp;nbsp;&amp;nbsp; x=catx(' ',Sex,'SubTotal',':&amp;nbsp;&amp;nbsp;&amp;nbsp; ',weight.sum);
&amp;nbsp;&amp;nbsp; line x $varying50. len;
&amp;nbsp; endcomp;
compute after /style(lines)={just=r asis=on} ;
&amp;nbsp;&amp;nbsp; x=catx(' ','Total',': ',weight.sum);
&amp;nbsp;&amp;nbsp; line x $varying50. len;
&amp;nbsp; endcomp;&amp;nbsp; run;
quit;

&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;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 14:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208207#M13804</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-25T14:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208208#M13805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two things, this works to select particular categories, but i need to do it based on counts in the category either inside the proc report, or with something like this:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test2 as select&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;from test a&lt;/P&gt;&lt;P&gt;left join (select sex, count(*) as sexcount from test group by sex) b&lt;/P&gt;&lt;P&gt;on a.sex = b.sex;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, what do those len\line statements do?&amp;nbsp; I'm not familiar with them.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 14:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208208#M13805</guid>
      <dc:creator>wcp_fnfg</dc:creator>
      <dc:date>2015-03-25T14:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208209#M13806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK. here is . I have to go to sleep now .It is too late now. Good Luck.&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;&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;data tiki;&lt;/P&gt;&lt;P&gt;name='Tiki';&lt;/P&gt;&lt;P&gt;sex='C';&lt;/P&gt;&lt;P&gt;age=10;&lt;/P&gt;&lt;P&gt;height=6;&lt;/P&gt;&lt;P&gt;weight=9.5;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set sashelp.class tiki;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data=WORK.TEST nowd out=x;&lt;/P&gt;&lt;P&gt;&amp;nbsp; column Sex Name Weight;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define Sex / group 'Sex' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define Name / group 'Name' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; define Weight / analysis&amp;nbsp; 'Weight' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; compute weight;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; n+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if _break_='Sex' and n=2 then do;len=0; n=0;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else len=40;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; compute after Sex /style(lines)={just=r asis=on} ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; x=catx(' ',Sex,'SubTotal',':&amp;nbsp;&amp;nbsp;&amp;nbsp; ',weight.sum);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; line x $varying50. len;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp;&lt;/P&gt;&lt;P&gt;compute after /style(lines)={just=r asis=on} ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; x=catx(' ','Total',': ',weight.sum);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; line x $varying50. len;&lt;/P&gt;&lt;P&gt;&amp;nbsp; endcomp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 14:31:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208209#M13806</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-25T14:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208210#M13807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;varying&amp;nbsp; is a varying length format , if its length is 0 (i.e. len=0&amp;nbsp; in my code) , it will not print that variable x&amp;nbsp; (&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;line x $varying50. len;&lt;/SPAN&gt;).&lt;/P&gt;&lt;P&gt;Search it at&amp;nbsp; support.sas.com to find more about it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 14:34:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208210#M13807</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-25T14:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208211#M13808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think your counter works here because it doesn't seem to reset for each group.&amp;nbsp; Adding the group count before the report gets it done for me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data tiki;&lt;/P&gt;&lt;P&gt;name='Tiki';&lt;/P&gt;&lt;P&gt;sex='C';&lt;/P&gt;&lt;P&gt;age=10;&lt;/P&gt;&lt;P&gt;height=6;&lt;/P&gt;&lt;P&gt;weight=9.5;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set sashelp.class tiki;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test2 as select&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;from test a&lt;/P&gt;&lt;P&gt;left join (select sex, count(*) as sexcount from test group by sex) b&lt;/P&gt;&lt;P&gt;on a.sex = b.sex;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data=WORK.TEST2 nowd out=x;&lt;/P&gt;&lt;P&gt;column sexcount Sex Name Weight;&lt;/P&gt;&lt;P&gt;define sexcount /order noprint;&lt;/P&gt;&lt;P&gt;define Sex / group 'Sex' ;&lt;/P&gt;&lt;P&gt;define Name / group 'Name' ;&lt;/P&gt;&lt;P&gt;define Weight / analysis&amp;nbsp; 'Weight';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compute before sex;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length&amp;nbsp; text $ 50;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if sexcount&amp;gt;1 then len = 40; else len = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x=catx(' ',Sex,'SubTotal',':&amp;nbsp;&amp;nbsp;&amp;nbsp; ',weight.sum);&lt;/P&gt;&lt;P&gt;&amp;nbsp; line x $varying50. len;&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 14:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208211#M13808</guid>
      <dc:creator>wcp_fnfg</dc:creator>
      <dc:date>2015-03-25T14:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208212#M13809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I don't think your counter works here because it doesn't seem to reset for each group. "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Why did you say so ?&lt;/P&gt;&lt;P&gt;Did you run my code ? I get the desired output ,don't you ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 14:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208212#M13809</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-25T14:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208213#M13810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Correct, your code doesn't really work.&amp;nbsp; It suppresses the 1st line only.&amp;nbsp; If sex for Tiki = 'T', the counter doesn't work.&amp;nbsp; If there's another "single" entry later on, it doesn't work.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 15:19:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208213#M13810</guid>
      <dc:creator>wcp_fnfg</dc:creator>
      <dc:date>2015-03-25T15:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208214#M13811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ha. I know where is wrong !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;


 
data tiki;
name='Tiki';
sex='C';
age=10;
height=6;
weight=9.5;
run;
&amp;nbsp; data tiki1;
name='Tiki';
sex='T';
age=10;
height=6;
weight=9.5;
run;
data test;
set sashelp.class tiki tiki1;
run;
 
 
 
proc report data=WORK.TEST nowd out=x;
&amp;nbsp; column Sex Name Weight;
&amp;nbsp; define Sex / group 'Sex' ;
&amp;nbsp; define Name / group 'Name' ;
&amp;nbsp; define Weight / analysis&amp;nbsp; 'Weight' ;
&amp;nbsp; compute weight;
&amp;nbsp;&amp;nbsp; n+1;
&amp;nbsp;&amp;nbsp; if _break_='Sex' and n=2 then len=0;
&amp;nbsp;&amp;nbsp; if _break_='Sex' then n=0;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else len=40;
&amp;nbsp; endcomp;
&amp;nbsp; compute after Sex /style(lines)={just=r asis=on} ;
&amp;nbsp;&amp;nbsp; x=catx(' ',Sex,'SubTotal',':&amp;nbsp;&amp;nbsp;&amp;nbsp; ',weight.sum);
&amp;nbsp;&amp;nbsp; line x $varying50. len;
&amp;nbsp; endcomp;
compute after /style(lines)={just=r asis=on} ;
&amp;nbsp;&amp;nbsp; x=catx(' ','Total',': ',weight.sum);
&amp;nbsp;&amp;nbsp; line x $varying50. len;
&amp;nbsp; endcomp;&amp;nbsp; run;
quit;
&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;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 12:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208214#M13811</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-26T12:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208215#M13812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, this works.&amp;nbsp; The "line" statement still looks weird on the report, but thanks for the ideas.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 12:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208215#M13812</guid>
      <dc:creator>wcp_fnfg</dc:creator>
      <dc:date>2015-03-26T12:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208216#M13813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah. You need to adjust its style on your own. Maybe will cost you much time .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 12:50:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208216#M13813</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-26T12:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Conditional Subtotal?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208217#M13814</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;I learned that conditionally showing break lines (summaries) is not possible. Is that the same with doing tasks like the following (code does not work for me):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;define&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; tmp_Break / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;group&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;define&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; Var1 / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;group&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;'Group'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;compute&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;after&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; tmp_Break;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; _break_ eq &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;"TMP_BREAK"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; and tmp_Break eq &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Var1 = "This is the first group"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; _break_ eq &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;"TMP_BREAK"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; and tmp_Break eq &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Var1 = "This is the second group"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;endcomp&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;The (&lt;/SPAN&gt;tmp_Break &lt;SPAN style="color: #000000; font-family: arial,helvetica,sans-serif;"&gt;eq &lt;SPAN style="font-size: 10pt;"&gt;0/1) condition does not work and I dont know why. I doublechecked the variable so it contains only ones and zeros.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;Tobias&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2015 09:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Conditional-Subtotal/m-p/208217#M13814</guid>
      <dc:creator>Tobias_N</dc:creator>
      <dc:date>2015-05-04T09:52:20Z</dc:date>
    </item>
  </channel>
</rss>

