<?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: Debug error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972858#M377581</link>
    <description>&lt;P&gt;In FedSQL, the function DATEPART() is not valid, which is why you are getting a syntax error. If your column REPONSE_DATE is already stored as a DATE, you can directly compare it using WHERE t1.REPONSE_DATE = DATE '2025-07-15'. If it is a DATETIME, you should first cast it to a DATE and then compare, for example WHERE CAST(t1.REPONSE_DATE AS DATE) = DATE '2025-07-15'. This will fix your error and run correctly.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Aug 2025 04:57:21 GMT</pubDate>
    <dc:creator>jennifertaylor</dc:creator>
    <dc:date>2025-08-19T04:57:21Z</dc:date>
    <item>
      <title>Debug error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972614#M377538</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Someone can help me. Why I have a synthax error. I'm surprised to see that Datepart is not colored in Blue. My variable is in date format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's a FEDSQL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YannRC_0-1755170364245.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/108996i85B43BF1AC9696F5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YannRC_0-1755170364245.png" alt="YannRC_0-1755170364245.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2025 11:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972614#M377538</guid>
      <dc:creator>YannRC</dc:creator>
      <dc:date>2025-08-14T11:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Debug error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972621#M377541</link>
      <description>&lt;P&gt;You must not have a space between &amp;lt;DATE&amp;gt; and your constant.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2025 14:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972621#M377541</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2025-08-14T14:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Debug error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972623#M377542</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YannRC_0-1755183699039.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/108997iB04147A7343A3FD9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YannRC_0-1755183699039.png" alt="YannRC_0-1755183699039.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's the same result without space. I remove also all the space. Same error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":loudly_crying_face:"&gt;😭&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2025 15:02:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972623#M377542</guid>
      <dc:creator>YannRC</dc:creator>
      <dc:date>2025-08-14T15:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Debug error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972626#M377543</link>
      <description>&lt;P&gt;What type of library engine is being used by the OA libref you mentioned in your code snippet?&amp;nbsp;Perhaps FEDSQL is having trouble pushing your WHERE clause into an external database?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: If the variable has DATE values why are you trying to run DATEPART() function on it?&amp;nbsp; That only works when the variable has DATETIME values (what other languages call TIMESTAMP values).&amp;nbsp; DATE values in SAS are number of days since 1960 and DATETIME values are number of seconds.&amp;nbsp; So passing a DATE value to the DATEPART() function will result in the date of 01JAN1960 (or possibly 31DEC1959 if the date was before 1960).&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2025 15:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972626#M377543</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-08-14T15:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Debug error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972641#M377545</link>
      <description>&lt;P&gt;You are using SAS SQL so the correct way to define a date constant in SAS SQL is: '15Jul2025'd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2025 20:03:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972641#M377545</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-08-14T20:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Debug error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972661#M377551</link>
      <description>&lt;P&gt;&lt;EM&gt;"It's a FEDSQL"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;No it's not, you have "proc sql;" in your program.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you wish to use FedSQL syntax you actually need to use the FedSQL procedure.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 06:02:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972661#M377551</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2025-08-15T06:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Debug error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972858#M377581</link>
      <description>&lt;P&gt;In FedSQL, the function DATEPART() is not valid, which is why you are getting a syntax error. If your column REPONSE_DATE is already stored as a DATE, you can directly compare it using WHERE t1.REPONSE_DATE = DATE '2025-07-15'. If it is a DATETIME, you should first cast it to a DATE and then compare, for example WHERE CAST(t1.REPONSE_DATE AS DATE) = DATE '2025-07-15'. This will fix your error and run correctly.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 04:57:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972858#M377581</guid>
      <dc:creator>jennifertaylor</dc:creator>
      <dc:date>2025-08-19T04:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Debug error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972860#M377582</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LinusH_0-1755588782078.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109095i3A80FA0040E1A1CB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LinusH_0-1755588782078.png" alt="LinusH_0-1755588782078.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 07:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-error/m-p/972860#M377582</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2025-08-19T07:33:19Z</dc:date>
    </item>
  </channel>
</rss>

