<?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 ACCESS/Hadoop, PROC SQL, WHERE statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ACCESS-Hadoop-PROC-SQL-WHERE-statement/m-p/528875#M144404</link>
    <description>&lt;P&gt;(Hortonworks Hadoop accessed via SAS ACCESS/Hadoop, a Kerberos enviornment)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are there any limitation using WHERE predicate in a PROC SQL statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; create table a as select *&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; from hdp_tb.transact x&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;where x.order&amp;nbsp; &amp;lt; 100 ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only get 0 obs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I break it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; create table a as select from hdp_tb.transact x&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;create table b as select from a&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; where&amp;nbsp;&lt;SPAN&gt;x.order&amp;nbsp; &amp;lt; 100&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get obs, and vars returned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What am i doing wrong or is there a limitation?&amp;nbsp; Is my construct in-correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your input&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;S&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jan 2019 20:10:18 GMT</pubDate>
    <dc:creator>shoin</dc:creator>
    <dc:date>2019-01-21T20:10:18Z</dc:date>
    <item>
      <title>ACCESS/Hadoop, PROC SQL, WHERE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ACCESS-Hadoop-PROC-SQL-WHERE-statement/m-p/528875#M144404</link>
      <description>&lt;P&gt;(Hortonworks Hadoop accessed via SAS ACCESS/Hadoop, a Kerberos enviornment)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are there any limitation using WHERE predicate in a PROC SQL statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; create table a as select *&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; from hdp_tb.transact x&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;where x.order&amp;nbsp; &amp;lt; 100 ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only get 0 obs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I break it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; create table a as select from hdp_tb.transact x&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;create table b as select from a&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; where&amp;nbsp;&lt;SPAN&gt;x.order&amp;nbsp; &amp;lt; 100&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get obs, and vars returned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What am i doing wrong or is there a limitation?&amp;nbsp; Is my construct in-correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your input&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;S&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 20:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ACCESS-Hadoop-PROC-SQL-WHERE-statement/m-p/528875#M144404</guid>
      <dc:creator>shoin</dc:creator>
      <dc:date>2019-01-21T20:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: ACCESS/Hadoop, PROC SQL, WHERE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ACCESS-Hadoop-PROC-SQL-WHERE-statement/m-p/528879#M144408</link>
      <description>&lt;P&gt;Not really clear what you are doing since your last query is referencing X, but doesn't define X.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing to note is the difference in how other systems handle missing values (what they refer to as NULL values).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS all comparisons, like ORDER &amp;lt; 100, use binary logic.&amp;nbsp; They are either TRUE or FALSE.&amp;nbsp; To make this possible SAS treats missing numeric values is less than any valid numeric value.&amp;nbsp; So the test (. &amp;lt; 100) is TRUE.&amp;nbsp; And the test (. &amp;gt; 100) is FALSE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it other SQL implementations they use essentially tri-level logic.&amp;nbsp; The result can either be TRUE, FALSE or unknown.&amp;nbsp; So (null &amp;lt; 100) not TRUE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So perhaps your data has missing values for ORDER.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; where (x.order &amp;lt; 100) or (x.order is null)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Jan 2019 20:31:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ACCESS-Hadoop-PROC-SQL-WHERE-statement/m-p/528879#M144408</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-01-21T20:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: ACCESS/Hadoop, PROC SQL, WHERE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ACCESS-Hadoop-PROC-SQL-WHERE-statement/m-p/528912#M144428</link>
      <description>&lt;P&gt;Thank you, the x.order (as you pointed out) is a typo.&amp;nbsp; I did not catch it and stand corrected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The question is that the first sql where predicate brings 0 obs and in the second attempt; the 2 sql statements (for a moment ignore x.order and assume it is order &amp;lt; 100) it does bring back results.&amp;nbsp; I am only trying to find out as to why would that be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TIA&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;S&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 21:40:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ACCESS-Hadoop-PROC-SQL-WHERE-statement/m-p/528912#M144428</guid>
      <dc:creator>shoin</dc:creator>
      <dc:date>2019-01-21T21:40:10Z</dc:date>
    </item>
  </channel>
</rss>

