<?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: why some where conditions dont work on sql passthrough in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/why-some-where-conditions-dont-work-on-sql-passthrough/m-p/137083#M261207</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try&lt;/P&gt;&lt;P&gt;Where not missing(acctno);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also many databases really don't understand Missing the way SAS does but will report NULL or similar. You may need to find out what the specific data base uses and use something like&lt;/P&gt;&lt;P&gt;Where acctno ne 'NULL';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless it is a serious performance issue it may be easier to read in all of the data and filter on the output data set after you know what values are coming in.&lt;/P&gt;&lt;P&gt;data answer (where=( acctno ne 'NULL')); after looking at some of the data for acctno.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jun 2014 23:14:47 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-06-10T23:14:47Z</dc:date>
    <item>
      <title>why some where conditions dont work on sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-some-where-conditions-dont-work-on-sql-passthrough/m-p/137082#M261206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I was just asked a question from a colleague that I honestly didn't know how to answer, or if my impression is even correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So sometimes when you define a libname to a sql databse (like below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname testy odbc dsn='mymadeupdsn' schema=dbo bulkload=yes dbmax_text=32000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and you try to run the following code it fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data answer;&lt;/P&gt;&lt;P&gt;set testy.Tabledata;&lt;/P&gt;&lt;P&gt;where missing(acctno)=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is my understanding (PLEASE correct me if I am wrong) that sas tries to pass the syntax for the function in question over to the sql database when you use a where clause, and maybe sql server doesn't understand this function so it fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anyone point me to a paper illustrating this, and or an option that would allow me to see what exact syntax is being passed to the database (and what is being returned). I am well aware of pass through functionality, and I know this is not the best way to do this, but It was a question that was asked that I frankly froze on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2014 22:03:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-some-where-conditions-dont-work-on-sql-passthrough/m-p/137082#M261206</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2014-06-10T22:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: why some where conditions dont work on sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-some-where-conditions-dont-work-on-sql-passthrough/m-p/137083#M261207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try&lt;/P&gt;&lt;P&gt;Where not missing(acctno);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also many databases really don't understand Missing the way SAS does but will report NULL or similar. You may need to find out what the specific data base uses and use something like&lt;/P&gt;&lt;P&gt;Where acctno ne 'NULL';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless it is a serious performance issue it may be easier to read in all of the data and filter on the output data set after you know what values are coming in.&lt;/P&gt;&lt;P&gt;data answer (where=( acctno ne 'NULL')); after looking at some of the data for acctno.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2014 23:14:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-some-where-conditions-dont-work-on-sql-passthrough/m-p/137083#M261207</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-06-10T23:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: why some where conditions dont work on sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-some-where-conditions-dont-work-on-sql-passthrough/m-p/137084#M261208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've never used SQL Server so I can't help you with the specifics about how it handles null (or in SAS terms missing) values but you might find more luck if you used explicit passthrough rather than letting the ODBC engine do the conversion work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2014 23:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-some-where-conditions-dont-work-on-sql-passthrough/m-p/137084#M261208</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2014-06-10T23:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: why some where conditions dont work on sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-some-where-conditions-dont-work-on-sql-passthrough/m-p/137085#M261209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;options sastrace=',,,d' sastraceloc=saslog;&lt;/P&gt;&lt;P&gt;will let you know if/how your where-clase will be translated to in ODBC SQL.&lt;/P&gt;&lt;P&gt;Using NOT NULL or similar would make it more likely for implicit pass-thru.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 07:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-some-where-conditions-dont-work-on-sql-passthrough/m-p/137085#M261209</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-06-11T07:23:55Z</dc:date>
    </item>
  </channel>
</rss>

