<?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: convert sas date to teradata date in proc sql where clause in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/convert-sas-date-to-teradata-date-in-proc-sql-where-clause/m-p/464850#M70525</link>
    <description>&lt;P&gt;Try formatting temp_3.DOB as &lt;STRONG&gt;format yymmdd10. &lt;/STRONG&gt;before joining.&amp;nbsp; That's worked before.&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV id="page" class="hfeed site"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Thu, 24 May 2018 17:34:06 GMT</pubDate>
    <dc:creator>tomrvincent</dc:creator>
    <dc:date>2018-05-24T17:34:06Z</dc:date>
    <item>
      <title>convert sas date to teradata date in proc sql where clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/convert-sas-date-to-teradata-date-in-proc-sql-where-clause/m-p/464840#M70524</link>
      <description>&lt;P&gt;I want to convert a sas date to Teradata date in the where clause below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; temp_4 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; a.counter, max(c.ID) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; CI_ID&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; temp_3 a&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;left&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;table.abc b &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ON&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; a.H_ID = b.X_ID &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;inner&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;table.def c &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ON&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; b.CI_ID = c.CI_ID&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;left&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;table.ghi d &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ON&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; c.CI_ID = d.CI_ID&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; b.type =&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'HI'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; substr(c.CI_LAST_NM,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;12&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) = a.Surname &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; substr(c.CI_FRST_NM,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;7&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) = a.First_Name&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; c.CI_BIR_DT = a.DOB &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; c.CI_SEX_C = a.gen &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;group&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; a.counter&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;quit&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New"&gt;c.CI_BIR_DT = a.DOB CI_BIR_DT is a Teradata date and a.DOB is the sas date. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;I tried a few options but failed to get the correct result. Please advise. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Many Thanks!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 17:07:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/convert-sas-date-to-teradata-date-in-proc-sql-where-clause/m-p/464840#M70524</guid>
      <dc:creator>mraza12</dc:creator>
      <dc:date>2018-05-24T17:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: convert sas date to teradata date in proc sql where clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/convert-sas-date-to-teradata-date-in-proc-sql-where-clause/m-p/464850#M70525</link>
      <description>&lt;P&gt;Try formatting temp_3.DOB as &lt;STRONG&gt;format yymmdd10. &lt;/STRONG&gt;before joining.&amp;nbsp; That's worked before.&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV id="page" class="hfeed site"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 24 May 2018 17:34:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/convert-sas-date-to-teradata-date-in-proc-sql-where-clause/m-p/464850#M70525</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2018-05-24T17:34:06Z</dc:date>
    </item>
  </channel>
</rss>

