<?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 operators in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-operators/m-p/50609#M13828</link>
    <description>Because =ANY(...)  is not a valid SQL statement in SAS.</description>
    <pubDate>Thu, 14 Apr 2011 16:39:13 GMT</pubDate>
    <dc:creator>RickM</dc:creator>
    <dc:date>2011-04-14T16:39:13Z</dc:date>
    <item>
      <title>PROC SQL operators</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-operators/m-p/50608#M13827</link>
      <description>Given the SAS data sets:&lt;BR /&gt;
&lt;BR /&gt;
WORK.EMPLOYEE                WORK.NEWEMPLOYEE&lt;BR /&gt;
&lt;BR /&gt;
Name Dept                               Names Salary&lt;BR /&gt;
-------- -----                                  -------- ------&lt;BR /&gt;
Alan Sales                                Michelle 50000&lt;BR /&gt;
Michelle Sales                         Paresh 60000&lt;BR /&gt;
&lt;BR /&gt;
A SAS program is submitted and&lt;BR /&gt;
the following is written to the SAS log:&lt;BR /&gt;
101 proc sql;&lt;BR /&gt;
102 select dept, name&lt;BR /&gt;
103 from WORK.EMPLOYEE&lt;BR /&gt;
104 where name=(select names&lt;BR /&gt;
from newemployee&lt;BR /&gt;
where salary &amp;gt; 40000)&lt;BR /&gt;
ERROR: Subquery evaluated to more than one row.&lt;BR /&gt;
105 ;&lt;BR /&gt;
106 quit;&lt;BR /&gt;
What would allow the program to&lt;BR /&gt;
successfully execute without errors?&lt;BR /&gt;
A.&lt;BR /&gt;
Replace the where clause with:&lt;BR /&gt;
where EMPLOYEE.Name=(select Names delimited with ','&lt;BR /&gt;
from WORK.NEWEMPLOYEE&lt;BR /&gt;
where Salary &amp;gt; 40000);&lt;BR /&gt;
B.&lt;BR /&gt;
Replace line 104 with:&lt;BR /&gt;
where EMPLOYEE.Name =ANY (select Names separated with ','&lt;BR /&gt;
from WORK.NEWEMPLOYEE&lt;BR /&gt;
where Salary &amp;gt; 40000);&lt;BR /&gt;
C.&lt;BR /&gt;
Replace the equal sign with the IN operator.&lt;BR /&gt;
D.&lt;BR /&gt;
Qualify the column names with the table names.&lt;BR /&gt;
Answer:(C)&lt;BR /&gt;
&lt;BR /&gt;
I am wondering why (B) is not correct. Any thoughts? Thanks a lot.</description>
      <pubDate>Thu, 14 Apr 2011 16:27:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-operators/m-p/50608#M13827</guid>
      <dc:creator>richard_hu2003</dc:creator>
      <dc:date>2011-04-14T16:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL operators</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-operators/m-p/50609#M13828</link>
      <description>Because =ANY(...)  is not a valid SQL statement in SAS.</description>
      <pubDate>Thu, 14 Apr 2011 16:39:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-operators/m-p/50609#M13828</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2011-04-14T16:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL operators</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-operators/m-p/50610#M13829</link>
      <description>presuming newemployee exists and you can match on the name column.&lt;BR /&gt;
&lt;BR /&gt;
where name in (select name&lt;BR /&gt;
from newemployee&lt;BR /&gt;
where salary &amp;gt; 40000)</description>
      <pubDate>Thu, 14 Apr 2011 18:18:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-operators/m-p/50610#M13829</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2011-04-14T18:18:50Z</dc:date>
    </item>
  </channel>
</rss>

