<?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 Error in implicit pass-through in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-in-implicit-pass-through/m-p/506799#M135870</link>
    <description>&lt;P&gt;I have&amp;nbsp; a code to select data of current and next month (for a particular year). But this would not work in December, as the values of months picked up will be 12 and 13:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test1 as&lt;/P&gt;&lt;P&gt;select distinct id from table A&lt;/P&gt;&lt;P&gt;where year(date)&amp;gt;= 2012&lt;/P&gt;&lt;P&gt;and (month(date)=(month(today()) + 1) OR (month(date)=month(today())));&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, now changed the code to following:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test2 as&lt;/P&gt;&lt;P&gt;select distinct id from table A&lt;/P&gt;&lt;P&gt;where year(date)&amp;gt;= 2012&lt;/P&gt;&lt;P&gt;and (month(intnx('month',date,0))=month(intnx('month',date,1,'s')) OR&amp;nbsp;&lt;SPAN&gt;(month(date)=month(today()));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The values&amp;nbsp;month(intnx('month',date,0)) and&amp;nbsp;month(intnx('month',date,1,'s')) are coming correctly when testing in sas dataset. But its not working in Proc SQL.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The log says:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SAS_SQL: Unable to convert the query to DBMS specific SQL statement due to an error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ACCESS_ENGINE: SQL statement was not passed to the DBMS, SAS will do the processing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Due to this the counts are not matching for test1 and test2 results (expecting same result counts for rundate 23OCT2018).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please help resolve this.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Oct 2018 12:18:55 GMT</pubDate>
    <dc:creator>UshaLatha</dc:creator>
    <dc:date>2018-10-23T12:18:55Z</dc:date>
    <item>
      <title>Error in implicit pass-through</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-implicit-pass-through/m-p/506799#M135870</link>
      <description>&lt;P&gt;I have&amp;nbsp; a code to select data of current and next month (for a particular year). But this would not work in December, as the values of months picked up will be 12 and 13:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test1 as&lt;/P&gt;&lt;P&gt;select distinct id from table A&lt;/P&gt;&lt;P&gt;where year(date)&amp;gt;= 2012&lt;/P&gt;&lt;P&gt;and (month(date)=(month(today()) + 1) OR (month(date)=month(today())));&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, now changed the code to following:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test2 as&lt;/P&gt;&lt;P&gt;select distinct id from table A&lt;/P&gt;&lt;P&gt;where year(date)&amp;gt;= 2012&lt;/P&gt;&lt;P&gt;and (month(intnx('month',date,0))=month(intnx('month',date,1,'s')) OR&amp;nbsp;&lt;SPAN&gt;(month(date)=month(today()));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The values&amp;nbsp;month(intnx('month',date,0)) and&amp;nbsp;month(intnx('month',date,1,'s')) are coming correctly when testing in sas dataset. But its not working in Proc SQL.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The log says:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SAS_SQL: Unable to convert the query to DBMS specific SQL statement due to an error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ACCESS_ENGINE: SQL statement was not passed to the DBMS, SAS will do the processing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Due to this the counts are not matching for test1 and test2 results (expecting same result counts for rundate 23OCT2018).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please help resolve this.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 12:18:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-implicit-pass-through/m-p/506799#M135870</guid>
      <dc:creator>UshaLatha</dc:creator>
      <dc:date>2018-10-23T12:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Error in implicit pass-through</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-in-implicit-pass-through/m-p/506809#M135877</link>
      <description>&lt;P&gt;intnx is a SAS function that is why.&amp;nbsp; You have to remember that SQL in a proc SQL when run locally is using the inbuilt SAS SQL compiler, which has access to the SAS functions.&amp;nbsp; If you are passing through the SQL code, then that code is taken as test to the database SQL compiler and run there, the SQL parser will not have the SAS functions.&amp;nbsp; Therefore you need to build your SQL using the destination platform, so if it is the database, then you would need to use the database functions to perform such a test, or write it yourself.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 12:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-in-implicit-pass-through/m-p/506809#M135877</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-23T12:52:15Z</dc:date>
    </item>
  </channel>
</rss>

