<?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 Group By Question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Group-By-Question/m-p/67693#M19369</link>
    <description>I think this would be much easier in a data step after you sort by address and age and then use first.address with by group processing to find the youngest.&lt;BR /&gt;
&lt;BR /&gt;
Good luck!</description>
    <pubDate>Fri, 27 Aug 2010 17:14:22 GMT</pubDate>
    <dc:creator>RickM</dc:creator>
    <dc:date>2010-08-27T17:14:22Z</dc:date>
    <item>
      <title>Proc SQL Group By Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Group-By-Question/m-p/67692#M19368</link>
      <description>Hello All,&lt;BR /&gt;
       I hope you can help me on this. In my dataset I have siblings and their addresses. I am trying to group all siblings by address, so I know all the siblings who reside at an address. Now in this group I only want to pick the youngest sibling and get that information. I am trying to do this in EG, I have the dataset sorted by mailing address, but I would like to know is there a way where I can get the youngest sibling in the group. (something like select top 1)&lt;BR /&gt;
Here is my dataset&lt;BR /&gt;
&lt;BR /&gt;
Address              name             age                &lt;BR /&gt;
111 street1          child1           5&lt;BR /&gt;
111 street1          child2           10&lt;BR /&gt;
&lt;BR /&gt;
In this group I only want to output info for&lt;BR /&gt;
child1&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks for any help&lt;BR /&gt;
Shri</description>
      <pubDate>Fri, 27 Aug 2010 17:07:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Group-By-Question/m-p/67692#M19368</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-08-27T17:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Group By Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Group-By-Question/m-p/67693#M19369</link>
      <description>I think this would be much easier in a data step after you sort by address and age and then use first.address with by group processing to find the youngest.&lt;BR /&gt;
&lt;BR /&gt;
Good luck!</description>
      <pubDate>Fri, 27 Aug 2010 17:14:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Group-By-Question/m-p/67693#M19369</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2010-08-27T17:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Group By Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Group-By-Question/m-p/67694#M19370</link>
      <description>Shri,&lt;BR /&gt;
&lt;BR /&gt;
What do you want to do if the youngest are twins?  If you don't confront any twins, or want multiple records in such a case, you could try something like:&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
  create table want as&lt;BR /&gt;
    select *&lt;BR /&gt;
      from have&lt;BR /&gt;
        group by Address&lt;BR /&gt;
          having age eq min(age)&lt;BR /&gt;
;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Art</description>
      <pubDate>Fri, 27 Aug 2010 19:14:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Group-By-Question/m-p/67694#M19370</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-08-27T19:14:22Z</dc:date>
    </item>
  </channel>
</rss>

