<?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 SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518970#M140502</link>
    <description>&lt;P&gt;Not a catch at all. I hadn't seen your submission before I posted. Both will give the same result, but sorted differently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And both will be wrong if OP wanted cow_id's with 4 records in &lt;U&gt;every&lt;/U&gt; year... &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Dec 2018 22:39:47 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2018-12-05T22:39:47Z</dc:date>
    <item>
      <title>PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518965#M140497</link>
      <description>&lt;P&gt;Hi all&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this code working correctly to get 4 records of each COW_ID by using all my dataset that contained 10 years of records, but I need to get 4 records for each cow_id for each year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;my data called have&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the&amp;nbsp;variable YEAR in this data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So How&amp;nbsp; I can to specify my requirement&amp;nbsp;by using this code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;barkamih&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
create table want as
select *
from have
group by COW_ID
having count(*) &amp;gt; 3  ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Dec 2018 22:25:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518965#M140497</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-12-05T22:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518966#M140498</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
create table want as
select *
from have
group by COW_ID, year
having count(*) &amp;gt; 3  ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;group by COW_ID, year&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Dec 2018 22:29:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518966#M140498</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-12-05T22:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518968#M140500</link>
      <description>&lt;P&gt;&lt;SPAN class="token keyword"&gt;group&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;by&lt;/SPAN&gt; &lt;FONT color="#ff6600"&gt;year, &lt;/FONT&gt;COW_ID&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 22:32:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518968#M140500</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-12-05T22:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518969#M140501</link>
      <description>&lt;P&gt;Good catch&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 22:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518969#M140501</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-12-05T22:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518970#M140502</link>
      <description>&lt;P&gt;Not a catch at all. I hadn't seen your submission before I posted. Both will give the same result, but sorted differently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And both will be wrong if OP wanted cow_id's with 4 records in &lt;U&gt;every&lt;/U&gt; year... &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 22:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518970#M140502</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-12-05T22:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518971#M140503</link>
      <description>&lt;P&gt;Oh Sir, I think you comprehended -"&lt;SPAN&gt;, but I need to get 4 records for each cow_id for each year. "&amp;nbsp; this correctly&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 22:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518971#M140503</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-12-05T22:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518973#M140505</link>
      <description>&lt;P&gt;&amp;nbsp;both of you are correct, the first reply get accepted and the second one got like, I'm trying to be equal for both of you hahaha, I hope I did.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks million my friends&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 22:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518973#M140505</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-12-05T22:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518975#M140506</link>
      <description>&lt;P&gt;It's all good. Just a thought, I think it;s better to end proc sql with&lt;STRONG&gt; quit;&lt;/STRONG&gt;&amp;nbsp;than&lt;STRONG&gt; run;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 22:54:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/518975#M140506</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-12-05T22:54:59Z</dc:date>
    </item>
  </channel>
</rss>

