<?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: Data Summary in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611645#M178296</link>
    <description>&lt;P&gt;You get multiple rows because CLASS tells SAS to do summaries based on each level of the variable in the CLASS statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all you want is a total sum, you can use the following. If you want something else, show us the input and expected output and we can help you fill in the middle logic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=RevenueData noprint nway missing;
var BadDebt revenue;
output out = RevData (drop = _type_ _freq_) sum=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 13 Dec 2019 16:38:57 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-12-13T16:38:57Z</dc:date>
    <item>
      <title>Data Summary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611561#M178249</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me out in summarizing data?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is my proc step:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table RevenueData as&lt;BR /&gt;select Loan_key,business_day&lt;BR /&gt;,revenue&lt;BR /&gt;,BadDebt&lt;BR /&gt;,BD_Date as COYearMonth format yymon.&lt;BR /&gt;,Rev_Date as RevYearMonth format yymon.&lt;BR /&gt;from TOtRevenueBD&lt;/P&gt;&lt;P&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to summarize this so that the result can be:&lt;/P&gt;&lt;P&gt;LoanKey TotRevenue RevYearMonth TotBadDebt COYearMonth&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used proc summary however it's not giving me my desired result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 13:32:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611561#M178249</guid>
      <dc:creator>Eugenio211</dc:creator>
      <dc:date>2019-12-13T13:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Data Summary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611564#M178251</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/302621"&gt;@Eugenio211&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can someone help me out in summarizing data?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this is my proc step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;create table RevenueData as&lt;BR /&gt;select Loan_key,business_day&lt;BR /&gt;,revenue&lt;BR /&gt;,BadDebt&lt;BR /&gt;,BD_Date as COYearMonth format yymon.&lt;BR /&gt;,Rev_Date as RevYearMonth format yymon.&lt;BR /&gt;from TOtRevenueBD&lt;/P&gt;
&lt;P&gt;;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to summarize this so that the result can be:&lt;/P&gt;
&lt;P&gt;LoanKey TotRevenue RevYearMonth TotBadDebt COYearMonth&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used proc summary however it's not giving me my desired result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show us the code you used for PROC SUMMARY. Show us the results, and explain what is wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, "summarize" is not a specific term ... do you want sums, or means, or percents, or something else?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 13:37:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611564#M178251</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-13T13:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Data Summary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611566#M178253</link>
      <description>&lt;P&gt;here is my proc summary step:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc summary data=RevenueData noprint nway missing;&lt;BR /&gt;class loan_key COYearMonth RevYearMonth;&lt;BR /&gt;var BadDebt revenue;&lt;BR /&gt;output out = RevData (drop = _type_ _freq_) sum=;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It does not summarize the data, the result is in multiple rows. (see attached). you will notice the multiple loan_keys&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 13:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611566#M178253</guid>
      <dc:creator>Eugenio211</dc:creator>
      <dc:date>2019-12-13T13:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Data Summary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611568#M178254</link>
      <description>&lt;P&gt;I want to sum the data.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 13:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611568#M178254</guid>
      <dc:creator>Eugenio211</dc:creator>
      <dc:date>2019-12-13T13:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Data Summary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611583#M178267</link>
      <description>&lt;P&gt;Sorry, I cannot download and open Microsoft Office documents. Please show a portion of the results in your reply, and explain what is wrong.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 14:37:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611583#M178267</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-13T14:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Data Summary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611645#M178296</link>
      <description>&lt;P&gt;You get multiple rows because CLASS tells SAS to do summaries based on each level of the variable in the CLASS statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all you want is a total sum, you can use the following. If you want something else, show us the input and expected output and we can help you fill in the middle logic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=RevenueData noprint nway missing;
var BadDebt revenue;
output out = RevData (drop = _type_ _freq_) sum=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Dec 2019 16:38:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611645#M178296</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-12-13T16:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Data Summary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611711#M178338</link>
      <description>&lt;P&gt;You should provide some starting data and what you expect the result to be along with any rules.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Providing undesired output without a &lt;STRONG&gt;very explicit&lt;/STRONG&gt; description as to why it is undesired (such as the actual desired output) is relatively useless.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CLASS variables in Proc Summary (and means and many other SAS procedures) create groups of output. If you don't want each level of a variable to create a row of output then it likely doesn't belong on a Class statement. If you want to create a group of values from DATES such as calendar month for each year then apply an appropriate format in Proc Summary. Then the Formatted value will be used for the group. I suspect that is what you missed in your code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;format COYearMonth RevYearMonth yymon. ;&lt;/P&gt;
&lt;P&gt;or similar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 19:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Summary/m-p/611711#M178338</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-13T19:37:41Z</dc:date>
    </item>
  </channel>
</rss>

