<?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: Recreate Table with Grouping Months and Average Price in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Recreate-Table-with-Grouping-Months-and-Average-Price/m-p/581063#M13632</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/285175"&gt;@vitalam89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SQL is very simple too&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input date :date9. price;
format date date9.;
cards;
01jul1994 10
02may1995 15
10may1995 20
16jun1995 25
28jun1995 30
;

proc sql;
create table want as
select put(date,monyy7.) as Month_year, avg(price) as Average_price
from have
group by Month_year;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Aug 2019 11:52:06 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-08-14T11:52:06Z</dc:date>
    <item>
      <title>Recreate Table with Grouping Months and Average Price</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Recreate-Table-with-Grouping-Months-and-Average-Price/m-p/581050#M13630</link>
      <description>&lt;P&gt;New to SAS.&lt;/P&gt;&lt;P&gt;I currently need to summarize some data and know what is the average price of each month.&lt;/P&gt;&lt;P&gt;I have data like this:&lt;/P&gt;&lt;P&gt;Date&amp;nbsp; &amp;nbsp; /&amp;nbsp; &amp;nbsp;Price&lt;/P&gt;&lt;P&gt;19-05-23&amp;nbsp; &amp;nbsp;50&lt;/P&gt;&lt;P&gt;19-05-23&amp;nbsp; &amp;nbsp;80&lt;/P&gt;&lt;P&gt;19-05-24&amp;nbsp; &amp;nbsp;50&lt;/P&gt;&lt;P&gt;19-05-25 ..........cont.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to have a dataset like this:&lt;/P&gt;&lt;P&gt;Month&amp;nbsp; &amp;nbsp;/&amp;nbsp; Average Price&lt;/P&gt;&lt;P&gt;May 2019&amp;nbsp; &amp;nbsp;70&lt;/P&gt;&lt;P&gt;Jun 2019&amp;nbsp; &amp;nbsp; 90 ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help! A million thanks!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 11:02:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Recreate-Table-with-Grouping-Months-and-Average-Price/m-p/581050#M13630</guid>
      <dc:creator>vitalam89</dc:creator>
      <dc:date>2019-08-14T11:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Recreate Table with Grouping Months and Average Price</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Recreate-Table-with-Grouping-Months-and-Average-Price/m-p/581052#M13631</link>
      <description>&lt;P&gt;Welcome to the SAS Community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input date :date9. price;
format dates date9.;
cards;
01jul1994 10
02may1995 15
10may1995 20
16jun1995 25
28jun1995 30
;

proc summary data=have nway;
  class date;
  format date monyy7.;
  var price;
  output out=want(drop=_TYPE_ _FREQ_) mean=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Aug 2019 11:12:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Recreate-Table-with-Grouping-Months-and-Average-Price/m-p/581052#M13631</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-14T11:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Recreate Table with Grouping Months and Average Price</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Recreate-Table-with-Grouping-Months-and-Average-Price/m-p/581063#M13632</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/285175"&gt;@vitalam89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SQL is very simple too&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input date :date9. price;
format date date9.;
cards;
01jul1994 10
02may1995 15
10may1995 20
16jun1995 25
28jun1995 30
;

proc sql;
create table want as
select put(date,monyy7.) as Month_year, avg(price) as Average_price
from have
group by Month_year;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Aug 2019 11:52:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Recreate-Table-with-Grouping-Months-and-Average-Price/m-p/581063#M13632</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-14T11:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Recreate Table with Grouping Months and Average Price</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Recreate-Table-with-Grouping-Months-and-Average-Price/m-p/581068#M13633</link>
      <description>Thank you very much!</description>
      <pubDate>Wed, 14 Aug 2019 12:11:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Recreate-Table-with-Grouping-Months-and-Average-Price/m-p/581068#M13633</guid>
      <dc:creator>vitalam89</dc:creator>
      <dc:date>2019-08-14T12:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Recreate Table with Grouping Months and Average Price</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Recreate-Table-with-Grouping-Months-and-Average-Price/m-p/581069#M13634</link>
      <description>thank you very much!</description>
      <pubDate>Wed, 14 Aug 2019 12:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Recreate-Table-with-Grouping-Months-and-Average-Price/m-p/581069#M13634</guid>
      <dc:creator>vitalam89</dc:creator>
      <dc:date>2019-08-14T12:12:11Z</dc:date>
    </item>
  </channel>
</rss>

