<?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 PROC REPORT-SUMMARIZING DATA in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMARIZING-DATA/m-p/63649#M7462</link>
    <description>Hello all;&lt;BR /&gt;
I have a couple of questions regarding Proc report/Proc SQL in terms of summarizing data..&lt;BR /&gt;
&lt;BR /&gt;
What I have is this...&lt;BR /&gt;
month	rater	compliance&lt;BR /&gt;
NOV10	A	1&lt;BR /&gt;
NOV10	A	0&lt;BR /&gt;
NOV10	A	1&lt;BR /&gt;
NOV10	A	1&lt;BR /&gt;
NOV10	B	0&lt;BR /&gt;
NOV10	B	1&lt;BR /&gt;
DEC10	A	1&lt;BR /&gt;
DEC10	A	0&lt;BR /&gt;
DEC10	A	0&lt;BR /&gt;
DEC10	A	0&lt;BR /&gt;
DEC10	B	1&lt;BR /&gt;
DEC10	B	1&lt;BR /&gt;
&lt;BR /&gt;
What I can get using proc sql code:&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table HH2 as select distinct month, rater length 30, sum(compliance) as compliance, count(*) as counts,&lt;BR /&gt;
sum(compliance2)/count(*) format percent10. as compliance_rate&lt;BR /&gt;
from HH&lt;BR /&gt;
group by rater;&lt;BR /&gt;
order by month;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
I get: &lt;BR /&gt;
Month	RATER	COUNT	Compliance (sum)	Compliance rate&lt;BR /&gt;
NOV10	A	4	3	                 75%&lt;BR /&gt;
NOV10	B	2	1	                 50%&lt;BR /&gt;
DEC10	A	4	1	                 25%&lt;BR /&gt;
DEC10	B	2	2	                100%&lt;BR /&gt;
 &lt;BR /&gt;
what I need to get is:&lt;BR /&gt;
&lt;BR /&gt;
Month	RATER	COUNT	Compliance (sum)	Compliance rate&lt;BR /&gt;
NOV10	A	4	3	                   75%&lt;BR /&gt;
NOV10	B	2	1	                    50%&lt;BR /&gt;
TOTAL		6	4	                   67%&lt;BR /&gt;
				&lt;BR /&gt;
DEC10	A	4	1	                   25%&lt;BR /&gt;
DEC10	B	2	2	                   100%&lt;BR /&gt;
TOTAL		6	3	                    50%&lt;BR /&gt;
&lt;BR /&gt;
I have started with proc report but not have had much success. One of the issues is that when I group the months, its puts them in alpha order-Dec10 Nov10 rather than month/year order and I am not sure why. The dates are legitimate dates.&lt;BR /&gt;
&lt;BR /&gt;
I would be willing to do this is in proc report or proc sql but proc sql, whatever is easiest!&lt;BR /&gt;
&lt;BR /&gt;
Thanks so much for your help again!&lt;BR /&gt;
~Lawrence</description>
    <pubDate>Tue, 18 Jan 2011 20:55:14 GMT</pubDate>
    <dc:creator>_LB</dc:creator>
    <dc:date>2011-01-18T20:55:14Z</dc:date>
    <item>
      <title>PROC REPORT-SUMMARIZING DATA</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMARIZING-DATA/m-p/63649#M7462</link>
      <description>Hello all;&lt;BR /&gt;
I have a couple of questions regarding Proc report/Proc SQL in terms of summarizing data..&lt;BR /&gt;
&lt;BR /&gt;
What I have is this...&lt;BR /&gt;
month	rater	compliance&lt;BR /&gt;
NOV10	A	1&lt;BR /&gt;
NOV10	A	0&lt;BR /&gt;
NOV10	A	1&lt;BR /&gt;
NOV10	A	1&lt;BR /&gt;
NOV10	B	0&lt;BR /&gt;
NOV10	B	1&lt;BR /&gt;
DEC10	A	1&lt;BR /&gt;
DEC10	A	0&lt;BR /&gt;
DEC10	A	0&lt;BR /&gt;
DEC10	A	0&lt;BR /&gt;
DEC10	B	1&lt;BR /&gt;
DEC10	B	1&lt;BR /&gt;
&lt;BR /&gt;
What I can get using proc sql code:&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table HH2 as select distinct month, rater length 30, sum(compliance) as compliance, count(*) as counts,&lt;BR /&gt;
sum(compliance2)/count(*) format percent10. as compliance_rate&lt;BR /&gt;
from HH&lt;BR /&gt;
group by rater;&lt;BR /&gt;
order by month;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
I get: &lt;BR /&gt;
Month	RATER	COUNT	Compliance (sum)	Compliance rate&lt;BR /&gt;
NOV10	A	4	3	                 75%&lt;BR /&gt;
NOV10	B	2	1	                 50%&lt;BR /&gt;
DEC10	A	4	1	                 25%&lt;BR /&gt;
DEC10	B	2	2	                100%&lt;BR /&gt;
 &lt;BR /&gt;
what I need to get is:&lt;BR /&gt;
&lt;BR /&gt;
Month	RATER	COUNT	Compliance (sum)	Compliance rate&lt;BR /&gt;
NOV10	A	4	3	                   75%&lt;BR /&gt;
NOV10	B	2	1	                    50%&lt;BR /&gt;
TOTAL		6	4	                   67%&lt;BR /&gt;
				&lt;BR /&gt;
DEC10	A	4	1	                   25%&lt;BR /&gt;
DEC10	B	2	2	                   100%&lt;BR /&gt;
TOTAL		6	3	                    50%&lt;BR /&gt;
&lt;BR /&gt;
I have started with proc report but not have had much success. One of the issues is that when I group the months, its puts them in alpha order-Dec10 Nov10 rather than month/year order and I am not sure why. The dates are legitimate dates.&lt;BR /&gt;
&lt;BR /&gt;
I would be willing to do this is in proc report or proc sql but proc sql, whatever is easiest!&lt;BR /&gt;
&lt;BR /&gt;
Thanks so much for your help again!&lt;BR /&gt;
~Lawrence</description>
      <pubDate>Tue, 18 Jan 2011 20:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMARIZING-DATA/m-p/63649#M7462</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2011-01-18T20:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT-SUMMARIZING DATA</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMARIZING-DATA/m-p/63650#M7463</link>
      <description>&amp;gt; One of the issues is that when I group the&lt;BR /&gt;
&amp;gt; months, its puts them in alpha order-Dec10 Nov10&lt;BR /&gt;
&amp;gt; rather than month/year order and I am not sure why.&lt;BR /&gt;
&amp;gt; The dates are legitimate dates.&lt;BR /&gt;
&lt;BR /&gt;
By default, PROC REPORT orders the values of ORDER and GROUP variables by the formatted value. To order by the unformatted value, add the ORDER=INTERNAL option to the DEFINE statement for that column.&lt;BR /&gt;
&lt;BR /&gt;
(Don't confuse the ORDER option with the ORDER= option. The ORDER option says to order this column. The ORDER= option says &lt;I&gt;how&lt;/I&gt; to order it.)&lt;BR /&gt;
&lt;BR /&gt;
See &lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473627.htm" target="_blank"&gt;ORDER=DATA|FORMATTED|FREQ|INTERNAL&lt;/A&gt; in the PROC REPORT documentation for the DEFINE statement.&lt;I&gt;&lt;/I&gt;&lt;I&gt;&lt;/I&gt;&lt;I&gt;&lt;/I&gt;</description>
      <pubDate>Tue, 18 Jan 2011 21:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMARIZING-DATA/m-p/63650#M7463</guid>
      <dc:creator>Tim_SAS</dc:creator>
      <dc:date>2011-01-18T21:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT-SUMMARIZING DATA</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMARIZING-DATA/m-p/63651#M7464</link>
      <description>Tim;&lt;BR /&gt;
Thanks for the first part. That is the first step! &lt;BR /&gt;
~LB</description>
      <pubDate>Tue, 18 Jan 2011 21:11:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMARIZING-DATA/m-p/63651#M7464</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2011-01-18T21:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT-SUMMARIZING DATA</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMARIZING-DATA/m-p/63652#M7465</link>
      <description>Hi:&lt;BR /&gt;
 I generally use PROC TABULATE if I need more complicated percents (such as percent of row, percent of column, etc), but look at this report for PROC REPORT using SASHELP.CLASS, which has 19 total students (9 females and 10 males). For this report, I show the count and the percent of the grand total for each age group and each sex, so you can see how the BREAK and RBREAK statements work with the data and with the groups.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods html file='c:\temp\output\percent.html' style=sasweb;&lt;BR /&gt;
                                         &lt;BR /&gt;
  proc report data=sashelp.class nowd;&lt;BR /&gt;
    column sex age n pctn;&lt;BR /&gt;
    define sex / group;&lt;BR /&gt;
    define age / group;&lt;BR /&gt;
    define n / 'Count';&lt;BR /&gt;
    define pctn / 'Percent' f=percent9.2;&lt;BR /&gt;
    break after sex / summarize;&lt;BR /&gt;
    rbreak after / summarize;&lt;BR /&gt;
  run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 19 Jan 2011 00:31:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMARIZING-DATA/m-p/63652#M7465</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-01-19T00:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT-SUMMARIZING DATA</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMARIZING-DATA/m-p/63653#M7466</link>
      <description>Once again-Thanks Cynthia!</description>
      <pubDate>Wed, 19 Jan 2011 18:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMARIZING-DATA/m-p/63653#M7466</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2011-01-19T18:53:31Z</dc:date>
    </item>
  </channel>
</rss>

