<?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: ERROR: Syntax error while parsing WHERE clause. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Syntax-error-while-parsing-WHERE-clause/m-p/861053#M340132</link>
    <description>&lt;P&gt;SAS does not know what 01JANB2022 AND 28FEB2022 means. These can't be variable names because they start with a digit, and they are not text strings because they are no enclosed in quotes. So SAS is stumped.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you probably want is this (and note, I have fixed a typographical error in your code as well)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WHERE Account_Open_Dt BETWEEN '01JAN2022'd AND '28FEB2022'd;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you have a date enclosed in quotes and followed by the letter d then SAS understands you mean these to be actual dates. Also please note the format within the quotes, you have to use this exact format, 2 digit day, 3 letter month and 4 digit year, without change or alteration (except that the month can be lower case).&lt;/P&gt;</description>
    <pubDate>Mon, 27 Feb 2023 11:15:16 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-02-27T11:15:16Z</dc:date>
    <item>
      <title>ERROR: Syntax error while parsing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Syntax-error-while-parsing-WHERE-clause/m-p/861045#M340127</link>
      <description>&lt;P&gt;Good expects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please assist with the syntax of the below code as i am getting this error message&lt;BR /&gt;ERROR: Syntax error while parsing WHERE clause.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;DATA WANT;
SET  HAVE ;
WHERE Account_Open_Dt BETWEEN 01JANB2022 AND 28FEB2022 ;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Feb 2023 10:45:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Syntax-error-while-parsing-WHERE-clause/m-p/861045#M340127</guid>
      <dc:creator>Rixile106</dc:creator>
      <dc:date>2023-02-27T10:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Syntax error while parsing WHERE clause.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Syntax-error-while-parsing-WHERE-clause/m-p/861053#M340132</link>
      <description>&lt;P&gt;SAS does not know what 01JANB2022 AND 28FEB2022 means. These can't be variable names because they start with a digit, and they are not text strings because they are no enclosed in quotes. So SAS is stumped.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you probably want is this (and note, I have fixed a typographical error in your code as well)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WHERE Account_Open_Dt BETWEEN '01JAN2022'd AND '28FEB2022'd;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you have a date enclosed in quotes and followed by the letter d then SAS understands you mean these to be actual dates. Also please note the format within the quotes, you have to use this exact format, 2 digit day, 3 letter month and 4 digit year, without change or alteration (except that the month can be lower case).&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 11:15:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Syntax-error-while-parsing-WHERE-clause/m-p/861053#M340132</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-02-27T11:15:16Z</dc:date>
    </item>
  </channel>
</rss>

