<?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 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-subtotal/m-p/846220#M82319</link>
    <description>&lt;P&gt;HI:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; As an alternative, here's how you would achieve the report just using some "helper" variables and PROC REPORT with COMPUTE blocks. In this example, #1 and #2 are just the steps that lead to #3, which is the final report. This PROC REPORT is based on using the helper variables, as created in the modified DATA step program.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1669320770770.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77681iC01D91E98357A358/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1669320770770.png" alt="Cynthia_sas_0-1669320770770.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Thu, 24 Nov 2022 20:13:12 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2022-11-24T20:13:12Z</dc:date>
    <item>
      <title>Proc report subtotal</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-subtotal/m-p/845944#M82314</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a very simple question on the proc report.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data have;
format date ddmmyy10.;
input date  nature :$20. montant ;
datalines;
12926 test 	100
14926 test 	200
18926 test2 500
25926 test2 50
;
run;

proc report data=have ;
column ("Flux " date nature montant);
define date 		/ display 'Date de Saisie';
define nature  		/ display 'Type';
define montant    	/ display 'Mt';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want to had on the botom 2 subtotal lines, like this :&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.JPG" style="width: 350px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77614iE18EBF8D5FFAE42D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.JPG" alt="Capture1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that possible with a proc report without ordering / grouping the date ?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 14:07:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-subtotal/m-p/845944#M82314</guid>
      <dc:creator>blast</dc:creator>
      <dc:date>2022-11-23T14:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report subtotal</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-subtotal/m-p/846072#M82318</link>
      <description>&lt;P&gt;It is not right way to do this within a PROC REPORT.&lt;/P&gt;
&lt;P&gt;You need pre-process your data before PROC REPORT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
format date ddmmyy10.;
input date  nature :$20. montant ;
datalines;
12926 test 	100
14926 test 	200
18926 test2 500
25926 test2 50
;
run;

proc report data=have ;
column ("Flux " date nature montant) dummy;
define date 		/ display 'Date de Saisie';
define nature  		/ display 'Type';
define montant    	/ display 'Mt';
define dummy/computed noprint;
compute dummy;
if nature='test' then test+montant;
if nature='test2' then test2+montant;
endcomp;
compute after/style={just=l};
line ' ';
line   'Total' @25 'test' @35 test;
line   'Total' @25 'test2' @35 test2;
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1669262034171.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77653i39ED84AA0D21029C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1669262034171.png" alt="Ksharp_0-1669262034171.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 03:53:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-subtotal/m-p/846072#M82318</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-11-24T03:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report subtotal</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-subtotal/m-p/846220#M82319</link>
      <description>&lt;P&gt;HI:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; As an alternative, here's how you would achieve the report just using some "helper" variables and PROC REPORT with COMPUTE blocks. In this example, #1 and #2 are just the steps that lead to #3, which is the final report. This PROC REPORT is based on using the helper variables, as created in the modified DATA step program.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1669320770770.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77681iC01D91E98357A358/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1669320770770.png" alt="Cynthia_sas_0-1669320770770.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 20:13:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-subtotal/m-p/846220#M82319</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-11-24T20:13:12Z</dc:date>
    </item>
  </channel>
</rss>

