<?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: re: Selecting Rows in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/re-Selecting-Rows/m-p/175129#M44952</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, use an EXISTS clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table want as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select * &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from myTable as A&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where exists (select * from myTable where client=A.client and code in (1, 2, 3));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(untested)&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Oct 2014 18:44:25 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2014-10-07T18:44:25Z</dc:date>
    <item>
      <title>re: Selecting Rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/re-Selecting-Rows/m-p/175128#M44951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.....I have two variables - Client &amp;amp; Code. I would like to extract a list of Clients with their code where the code is either a 1 or 2 or 3 as well as the other codes for only these same clients. Can this done using a Proc SQL?...Thanks in Advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 18:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/re-Selecting-Rows/m-p/175128#M44951</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2014-10-07T18:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: re: Selecting Rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/re-Selecting-Rows/m-p/175129#M44952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, use an EXISTS clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table want as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select * &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from myTable as A&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where exists (select * from myTable where client=A.client and code in (1, 2, 3));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(untested)&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 18:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/re-Selecting-Rows/m-p/175129#M44952</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-10-07T18:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: re: Selecting Rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/re-Selecting-Rows/m-p/175130#M44953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input client code;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;1&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;2&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;2&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;3&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;3&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;3&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;4&amp;nbsp; 8&lt;/P&gt;&lt;P&gt;4&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data list;&lt;/P&gt;&lt;P&gt;input client;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select * from have&lt;/P&gt;&lt;P&gt;where client in (select client from list);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 18:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/re-Selecting-Rows/m-p/175130#M44953</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-10-07T18:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: re: Selecting Rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/re-Selecting-Rows/m-p/175131#M44954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks PG.....if I had 5 variables - Client, date_processed, code, eff_date, and ex_date and wanted to select the&amp;nbsp; row for the Client if the eff_dates and ex_dates are the same for the same client based on the maximum of date_processed to eliminate duplicates. Would a similar proc sql achieve this? Thanks in Advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 23:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/re-Selecting-Rows/m-p/175131#M44954</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2014-10-07T23:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: re: Selecting Rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/re-Selecting-Rows/m-p/175132#M44955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems quite different. Please post as a new question, with a small example. - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 01:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/re-Selecting-Rows/m-p/175132#M44955</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-10-08T01:37:04Z</dc:date>
    </item>
  </channel>
</rss>

