<?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 Multiple &amp;quot;Where&amp;quot; statements in a PROC SQL step? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195617#M48920</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all! I'm wondering if it is possible to tell SAS to include more than one WHERE clause in a PROC SQL, and if so, how? Here is what I attempted to do. I have 2 datasets, NOC_TRY4 and NOC_75. NOC_75 is a list of OCCGROUPS and CODES that I want to be included in the original dataset NOC_TRY4 - that is, any CODE within an OCCGROUP that is &lt;STRONG&gt;not&lt;/STRONG&gt; included in the list NOC_75 should be deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; GOODDATA &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;AS&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SELECT &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;* &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; NOC_TRY4, NOC_75&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;WHERE &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;NOC_75.OCCGROUP=NOC_TRY4.OCCGROUP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;WHERE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; NOC_75.CODE=NOC_TRY4.CODE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;QUIT;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS returns this error in the logs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;1413&amp;nbsp; PROC SQL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;1414&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CREATE TABLE NICETRY AS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;1415&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT * FROM NOC_TRY4, NOC_75&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;1416&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOC_75.OCCGROUP=NOC_TRY4.OCCGROUP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;1417&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOC_75.CODE=NOC_TRY4.CODE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -----&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 76&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;ERROR&lt;/STRONG&gt;&lt;BR /&gt;22-322: Syntax error, expecting one of the following: ;, !, !!, &amp;amp;, *, **,&lt;BR /&gt;+, -, /, &amp;lt;, &amp;lt;=,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND,&lt;BR /&gt;EQ, EQT, EXCEPT, GE, GET, GROUP, GT, GTT, HAVING, INTERSECT, LE,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET, LT, LTT, NE, NET, NOT, OR,&lt;BR /&gt;ORDER, OUTER, UNION, ^, ^=, |, ||, ~, ~=.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;ERROR&lt;/STRONG&gt;&lt;BR /&gt;76-322: Syntax error, statement will be ignored.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;1418&amp;nbsp; QUIT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;NOTE:&lt;BR /&gt;The SAS System stopped processing this step because of errors.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;NOTE:&lt;BR /&gt;PROCEDURE SQL used (Total process time):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt; mso-bidi-font-family: 'SAS Monospace';"&gt;Any help or tips would be greatly appreciated! Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG style="mso-bidi-font-family: 'SAS Monospace'; font-family: arial,helvetica,sans-serif;"&gt;(Please see my response to Reeza below for an update of the problem I keep running into)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 May 2015 19:39:50 GMT</pubDate>
    <dc:creator>grande44</dc:creator>
    <dc:date>2015-05-28T19:39:50Z</dc:date>
    <item>
      <title>Multiple "Where" statements in a PROC SQL step?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195617#M48920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all! I'm wondering if it is possible to tell SAS to include more than one WHERE clause in a PROC SQL, and if so, how? Here is what I attempted to do. I have 2 datasets, NOC_TRY4 and NOC_75. NOC_75 is a list of OCCGROUPS and CODES that I want to be included in the original dataset NOC_TRY4 - that is, any CODE within an OCCGROUP that is &lt;STRONG&gt;not&lt;/STRONG&gt; included in the list NOC_75 should be deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; GOODDATA &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;AS&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SELECT &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;* &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; NOC_TRY4, NOC_75&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;WHERE &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;NOC_75.OCCGROUP=NOC_TRY4.OCCGROUP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;WHERE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; NOC_75.CODE=NOC_TRY4.CODE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;QUIT;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS returns this error in the logs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;1413&amp;nbsp; PROC SQL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;1414&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CREATE TABLE NICETRY AS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;1415&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT * FROM NOC_TRY4, NOC_75&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;1416&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOC_75.OCCGROUP=NOC_TRY4.OCCGROUP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;1417&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE NOC_75.CODE=NOC_TRY4.CODE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -----&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 76&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;ERROR&lt;/STRONG&gt;&lt;BR /&gt;22-322: Syntax error, expecting one of the following: ;, !, !!, &amp;amp;, *, **,&lt;BR /&gt;+, -, /, &amp;lt;, &amp;lt;=,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND,&lt;BR /&gt;EQ, EQT, EXCEPT, GE, GET, GROUP, GT, GTT, HAVING, INTERSECT, LE,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET, LT, LTT, NE, NET, NOT, OR,&lt;BR /&gt;ORDER, OUTER, UNION, ^, ^=, |, ||, ~, ~=.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;ERROR&lt;/STRONG&gt;&lt;BR /&gt;76-322: Syntax error, statement will be ignored.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;1418&amp;nbsp; QUIT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;NOTE:&lt;BR /&gt;The SAS System stopped processing this step because of errors.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;NOTE:&lt;BR /&gt;PROCEDURE SQL used (Total process time):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt; mso-bidi-font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt; mso-bidi-font-family: 'SAS Monospace';"&gt;Any help or tips would be greatly appreciated! Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG style="mso-bidi-font-family: 'SAS Monospace'; font-family: arial,helvetica,sans-serif;"&gt;(Please see my response to Reeza below for an update of the problem I keep running into)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 19:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195617#M48920</guid>
      <dc:creator>grande44</dc:creator>
      <dc:date>2015-05-28T19:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "Where" statements in a PROC SQL step?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195618#M48921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not multiple WHERE statements, but multiple conditions in a single WHERE statement.&amp;nbsp; It looks like SAS is already suggesting the answer.&amp;nbsp; Replace the second "WHERE" with "AND".&amp;nbsp; See if that does what you need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 20:00:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195618#M48921</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-05-28T20:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "Where" statements in a PROC SQL step?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195619#M48922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy; background-color: white;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Use AND to join the WHERE conditions&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy; background-color: white;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white;"&gt;&lt;STRONG style=": ; color: #000080; font-style: inherit; font-size: 10pt;"&gt;&lt;SPAN style="font-family: inherit;"&gt;I would recommend explicitly listing your join type &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;as well as using ON instead of where in this particular instance - its faster processing.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy; background-color: white;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy; background-color: white;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;PROC &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: black;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; color: navy;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;SQL&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: blue;"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: black;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; color: blue;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt;"&gt; GOODDATA &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; color: blue;"&gt;AS&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: blue;"&gt;SELECT &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: black;"&gt;* &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: blue;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt; font-style: inherit; background-color: white; line-height: 1.5em;"&gt;NOC_TRY4&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; full join NOC_75&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: blue;"&gt;on &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: black;"&gt;NOC_75.OCCGROUP=NOC_TRY4.OCCGROUP&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: blue;"&gt;AND&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; background-color: white; color: black;"&gt; NOC_75.CODE=NOC_TRY4.CODE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy; background-color: white;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;QUIT;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 20:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195619#M48922</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-05-28T20:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "Where" statements in a PROC SQL step?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195620#M48923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds more like a left join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; GOODDATA &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;AS&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SELECT &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;* &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; NOC_TRY4 left join NOC_75&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; On&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;NOC_75.OCCGROUP=NOC_TRY4.OCCGROUP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; NOC_75.CODE=NOC_TRY4.CODE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;STRONG&gt;QUIT;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 21:00:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195620#M48923</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-05-28T21:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "Where" statements in a PROC SQL step?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195621#M48924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To extract NOC_TRY4 records which are also present in NOC_75, you need a simple inner join between the two tables&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;&amp;nbsp;&amp;nbsp; CREATE TABLE GOODDATA AS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; SELECT NOC_TRY4.* &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; FROM &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NOC_TRY4 inner join &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NOC_75 &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on NOC_75.OCCGROUP=NOC_TRY4.OCCGROUP and&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NOC_75.CODE=NOC_TRY4.CODE;&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;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 21:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195621#M48924</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-05-28T21:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "Where" statements in a PROC SQL step?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195622#M48925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="color: navy; font-size: 10pt; font-style: inherit; background-color: white; font-family: inherit;"&gt;&lt;STRONG&gt;If you are trying to get the NOC_TRY4 for either condition, then you use an "OR"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; GOODDATA &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;AS&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SELECT &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;* &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; NOC_TRY4, NOC_75&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;WHERE &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;NOC_75.OCCGROUP=NOC_TRY4.OCCGROUP OR &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;NOC_75.CODE=NOC_TRY4.CODE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;But if you are using the condition as exclusionary clauses and only want the results when both condition are true, then you use an "AND"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;CREATE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; GOODDATA &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;AS&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SELECT &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;* &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; NOC_TRY4, NOC_75&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;WHERE &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;NOC_75.OCCGROUP=NOC_TRY4.OCCGROUP AND &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;NOC_75.CODE=NOC_TRY4.CODE;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 00:53:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195622#M48925</guid>
      <dc:creator>morgalr</dc:creator>
      <dc:date>2015-05-29T00:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "Where" statements in a PROC SQL step?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195623#M48926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help, everyone. No matter what variation of PROC SQL I use, I run into the same problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOC_75 is a list of 1051 observations of Codes and their corresponding OccGroup. However, every time I use PROC SQL to create a new dataset using NOC_75 and NOC_TRY4, the result has more than 1051 observations. For example, the PROC SQL step suggested by Reeza yields a table with 1693 observations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But shouldn't I be left with only 1051 observations if there are only 1051 Codes in NOC_75?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 13:17:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195623#M48926</guid>
      <dc:creator>grande44</dc:creator>
      <dc:date>2015-05-29T13:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "Where" statements in a PROC SQL step?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195624#M48927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;In a ProcSQL step do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select count(1) from &amp;lt;your table name here&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will show you how many observations are truly in the table. You will not have a correct solution if you have more observations than available.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 14:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195624#M48927</guid>
      <dc:creator>morgalr</dc:creator>
      <dc:date>2015-05-29T14:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "Where" statements in a PROC SQL step?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195625#M48928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thats down to the logic of your join, has nothing to do with what syntax SAS uses.&amp;nbsp; I would suggest you read up on how joins work and what they return.&amp;nbsp; Here is an annotated display of each type of join and a visual of what they return.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/10675_Capture.PNG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;I would suggest from what you have given then you want the second on the left.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 14:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195625#M48928</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-29T14:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "Where" statements in a PROC SQL step?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195626#M48929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;
&lt;P&gt;grande44 wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;But shouldn't I be left with only 1051 observations if there are only 1051 Codes in NOC_75?&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not if there are duplicate keys in your data set, where the keys in your case are occgroup and code.&lt;/P&gt;&lt;P&gt;Try the following code to extract duplicates and unique records from NOC_75 and you can run the same thing for your other data set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort&lt;/P&gt;&lt;P&gt;&amp;nbsp; data = NOC_75&lt;/P&gt;&lt;P&gt;&amp;nbsp; out = duplicates_75&lt;/P&gt;&lt;P&gt;&amp;nbsp; uniqueout = singles_75&lt;/P&gt;&lt;P&gt;&amp;nbsp; nouniquekey;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by occgroup code;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 14:41:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195626#M48929</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-05-29T14:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "Where" statements in a PROC SQL step?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195627#M48930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, that seems to be the key issue. There are many duplicates in NOC_75 and I had not realized that this would be the case. It turns out I may need to go back to previous steps in my program to account for this possibility. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 15:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-quot-Where-quot-statements-in-a-PROC-SQL-step/m-p/195627#M48930</guid>
      <dc:creator>grande44</dc:creator>
      <dc:date>2015-05-29T15:05:22Z</dc:date>
    </item>
  </channel>
</rss>

