<?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: Teradata Passthrough Code for Date formats in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Teradata-Passthrough-Code-for-Date-formats/m-p/566752#M159346</link>
    <description>&lt;P&gt;To specify a date value in Teradata you should be able to use syntax like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'2019-06-17'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or be more precisely like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATE'2019-06-17'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Notice that Teradata uses only single quote characters around literal values.&amp;nbsp; Double quote characters are used around the names of objects (variables, tables, etc).&amp;nbsp; But the SAS macro processor will not resolve macro variable references inside of single quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So it is probably easiest to add the single quotes when you create the macro variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call symputx('CW_START',quote(put(CW_START,yymmdd10.),"'");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Then use the macro directly in your pass thru Teradata code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where date_var &amp;lt;= &amp;amp;cw_start&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 18 Jun 2019 01:18:47 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-06-18T01:18:47Z</dc:date>
    <item>
      <title>Teradata Passthrough Code for Date formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Teradata-Passthrough-Code-for-Date-formats/m-p/566711#M159319</link>
      <description>&lt;P&gt;In my code I am trying to use the passthrough to Teradata with SAS to automate a report. This automation i have defined dates.&lt;/P&gt;&lt;P&gt;in my Proc SQL using the Teradata passthrough&amp;nbsp; i refer to the CW_START and CW_END dates for a weekly report. However this doesnt work in the passthrough even though I formatted the dates as YYMMDD10.&lt;/P&gt;&lt;P&gt;Not sure what I am doing incorrectly here so any pointers would help immensely. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data DATES;&lt;BR /&gt;Format CW_START&lt;BR /&gt;CW_END&lt;BR /&gt;REPORTDATE&lt;BR /&gt;CURR_REPT_DATE&lt;BR /&gt;YYMMDD10.;&lt;/P&gt;&lt;P&gt;REPORTDATE = today()-1;&lt;BR /&gt;CURR_REPT_DATE = today();&lt;BR /&gt;CW_START = intnx('Week.4',ReportDate,0,'B');&lt;BR /&gt;CW_END = intnx('Week.4',ReportDate,0,'E');&lt;/P&gt;&lt;P&gt;Call Symput('REPORTDATE',REPORTDATE);&lt;BR /&gt;Call Symput('CW_START',CW_START);&lt;BR /&gt;Call Symput('CW_END',CW_END);&lt;BR /&gt;Call Symput('CURR_REPT_DATE',CURR_REPT_DATE);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 19:57:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Teradata-Passthrough-Code-for-Date-formats/m-p/566711#M159319</guid>
      <dc:creator>crashz204</dc:creator>
      <dc:date>2019-06-17T19:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Teradata Passthrough Code for Date formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Teradata-Passthrough-Code-for-Date-formats/m-p/566746#M159342</link>
      <description>&lt;P&gt;Try removing the format before you use the call symput.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Re-format in your final product.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dates in macro variables can be tricky!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 22:53:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Teradata-Passthrough-Code-for-Date-formats/m-p/566746#M159342</guid>
      <dc:creator>ehmsoleil</dc:creator>
      <dc:date>2019-06-17T22:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Teradata Passthrough Code for Date formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Teradata-Passthrough-Code-for-Date-formats/m-p/566752#M159346</link>
      <description>&lt;P&gt;To specify a date value in Teradata you should be able to use syntax like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'2019-06-17'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or be more precisely like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATE'2019-06-17'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Notice that Teradata uses only single quote characters around literal values.&amp;nbsp; Double quote characters are used around the names of objects (variables, tables, etc).&amp;nbsp; But the SAS macro processor will not resolve macro variable references inside of single quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So it is probably easiest to add the single quotes when you create the macro variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call symputx('CW_START',quote(put(CW_START,yymmdd10.),"'");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Then use the macro directly in your pass thru Teradata code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where date_var &amp;lt;= &amp;amp;cw_start&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jun 2019 01:18:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Teradata-Passthrough-Code-for-Date-formats/m-p/566752#M159346</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-06-18T01:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Teradata Passthrough Code for Date formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Teradata-Passthrough-Code-for-Date-formats/m-p/566980#M159410</link>
      <description>Thank You, this worked great!</description>
      <pubDate>Tue, 18 Jun 2019 17:43:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Teradata-Passthrough-Code-for-Date-formats/m-p/566980#M159410</guid>
      <dc:creator>crashz204</dc:creator>
      <dc:date>2019-06-18T17:43:22Z</dc:date>
    </item>
  </channel>
</rss>

