<?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: Summary line in proc print or proc report? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Summary-line-in-proc-print-or-proc-report/m-p/147091#M11467</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see how you get all the numbers in your chart except for the count of 5 in the column for C...it looks like the number at the bottom of the report should be 4 for C??&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Sep 2014 19:19:35 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2014-09-16T19:19:35Z</dc:date>
    <item>
      <title>Summary line in proc print or proc report?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Summary-line-in-proc-print-or-proc-report/m-p/147089#M11465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have following data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="43"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;obs&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="61"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;C&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="31"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;D&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="43"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="61"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Type 1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;B1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;C1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="31"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="43"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="61"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Type 1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;B1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;C2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="31"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="43"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="61"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Type 2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;B2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;C3&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="31"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="43"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="61"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Type 3&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;B3&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;C4&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="31"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;5&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a list (proc print or proc repot) like below. The “summary” line should show number of unique observations for variable A, B and C as well as SUM value for variable D.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="61"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;C&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="31"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;D&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="61"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Type 1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;B1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;C1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="31"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="61"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Type 1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;B1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;C2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="31"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="61"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Type 2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;B2&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;C3&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="31"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="61"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Type 3&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;B3&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;C4&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="31"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;5&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; border-top: none; padding: 0 5.4pt 0 5.4pt;" valign="top" width="61"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="37"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt; padding: 0 5.4pt 0 5.4pt;" valign="top" width="31"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;11&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below simple code get me a little bit forward:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=test noobs;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; var A B C D;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; sum D;&lt;BR /&gt; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what do I do for A, B and C? I need the number of unique observations for variable A, B and C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible with proc print or proc report?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 17:38:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Summary-line-in-proc-print-or-proc-report/m-p/147089#M11465</guid>
      <dc:creator>alr</dc:creator>
      <dc:date>2014-09-16T17:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Summary line in proc print or proc report?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Summary-line-in-proc-print-or-proc-report/m-p/147090#M11466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To get count of unique values you'll need at least one other step. Proc freq or proc means with levels or Proc SQL and select distinct can get the counts of unique values. Proc freq may be the best bet:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 19:09:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Summary-line-in-proc-print-or-proc-report/m-p/147090#M11466</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-09-16T19:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Summary line in proc print or proc report?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Summary-line-in-proc-print-or-proc-report/m-p/147091#M11467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see how you get all the numbers in your chart except for the count of 5 in the column for C...it looks like the number at the bottom of the report should be 4 for C??&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 19:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Summary-line-in-proc-print-or-proc-report/m-p/147091#M11467</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-09-16T19:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Summary line in proc print or proc report?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Summary-line-in-proc-print-or-proc-report/m-p/147092#M11468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;Yes, the number count for C should be 4.&lt;/P&gt;&lt;P&gt;Is it possible to use compute in proc report to get the count? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 19:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Summary-line-in-proc-print-or-proc-report/m-p/147092#M11468</guid>
      <dc:creator>alr</dc:creator>
      <dc:date>2014-09-16T19:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Summary line in proc print or proc report?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Summary-line-in-proc-print-or-proc-report/m-p/147093#M11469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure .&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 have;
input A &amp;amp; $ B $ C $ D ;
cards;
Type 1&amp;nbsp; B1&amp;nbsp; C1 1
Type 1&amp;nbsp; B1 C2 3
Type 2&amp;nbsp; B2 C3 2
Type 3&amp;nbsp; B3 C4 5
;
run;
ods listing close;
ods pdf file='x.pdf' style=sasweb;
proc report data=have nowd;
column a b c d;
define a /display;
define d /display;
compute d;
length x y z $ 400;
if not find(x,a) then do; x=catx(' ',x,a); xx+1;end;
if not find(y,b) then do; y=catx(' ',y,b);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;yy+1;end;
if not find(z,c) then do; z=catx(' ',z,c); zz+1;end;
sum+d;
endcomp;
compute after;
line @1 xx&amp;nbsp; yy&amp;nbsp; zz sum;
endcomp;
run;
ods pdf 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;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2014 12:44:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Summary-line-in-proc-print-or-proc-report/m-p/147093#M11469</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-09-17T12:44:04Z</dc:date>
    </item>
  </channel>
</rss>

