<?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: Where Statement to another environment in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Where-Statement-to-another-environment/m-p/104930#M21877</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just.This week, I noticed a change in adifferent Access engine. I think there may be some changes from 9.1 to 9.2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 05 May 2012 03:40:30 GMT</pubDate>
    <dc:creator>TomKari</dc:creator>
    <dc:date>2012-05-05T03:40:30Z</dc:date>
    <item>
      <title>Where Statement to another environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-Statement-to-another-environment/m-p/104929#M21876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following Syntax ALWAYS worked in SAS9.1, but immediately stopped working the day SAS 9.2 was installed.I do not believe that SAS9.2 lost the functionality.&amp;nbsp; Instead, I believe that there may have been a change in some parameters setting when it was installed.....would anybody know?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data sastable1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set teradata.table1;&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;&amp;nbsp; where datepart(report_date) le &amp;amp;cutoffdate.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The format of &amp;amp;cutoffdate is a pure sasdate, such as 19103.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, after the cutover to SAS9.2&amp;nbsp; I could only get this to work if I compared report_date to something with a format of '21Apr2012'd by specifying "%sysfunc(putn(&amp;amp;cutoffdate.,date9.))"d.&lt;/P&gt;&lt;P&gt;One explanation i received was that the "Where" statement is pushed to Teradata, and Teradata does not realize that 19103 is a date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fair enough - but WHY did it always work in SAS9.1&amp;nbsp; ???&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; What could have changed??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 May 2012 02:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-Statement-to-another-environment/m-p/104929#M21876</guid>
      <dc:creator>steve_citi</dc:creator>
      <dc:date>2012-05-05T02:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Where Statement to another environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-Statement-to-another-environment/m-p/104930#M21877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just.This week, I noticed a change in adifferent Access engine. I think there may be some changes from 9.1 to 9.2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 May 2012 03:40:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-Statement-to-another-environment/m-p/104930#M21877</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2012-05-05T03:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Where Statement to another environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-Statement-to-another-environment/m-p/104931#M21878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to me that SAS is moving more processing to database servers with every new version. If your DBMS doesn't use the same date representation as SAS, it will not interpret correctly a simple integer representing a SAS date. Nor can SAS guess that you mean that integer to be a date and convert it into a Teradata date. The macro solution you found is the right one, short of going upstream and getting the date form which that number is derived.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 May 2012 20:30:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-Statement-to-another-environment/m-p/104931#M21878</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-05-05T20:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Where Statement to another environment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-Statement-to-another-environment/m-p/104932#M21879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Pierre points out the likely reason for what you observe is that something gets now pushed to the database which before has been done within SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believed Datepart() is one of these SAS functions which beginning with SAS9.2 gets now pushed to the database. Interestingly its not on the list for Teradata:&amp;nbsp; &lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001630853.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001630853.htm"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001630853.htm&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By generating a string of '21Apr2012'd you give SAS the necessary information to know that this is a date (and not a number) and so SAS will be able to pass this date in an appropriate way to the DBMS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To see in the log what actually gets passed to the database and what's processed within SAS use the following option:&lt;/P&gt;&lt;P&gt;OPTIONS SASTRACE=',,,d' SASTRACELOC=SASLOG NOSTSUFFIX;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 May 2012 10:57:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-Statement-to-another-environment/m-p/104932#M21879</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-05-06T10:57:08Z</dc:date>
    </item>
  </channel>
</rss>

