<?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: SAS error message in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-message/m-p/611068#M178047</link>
    <description>&lt;P&gt;You tried to run this statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if date = 30NOV2018 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That is not valid syntax.&amp;nbsp; SAS is expecting a valid expression on the right of the equal sign. What you gave it is not a valie varaible name nor a number nor a character string.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely you intended to run this statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if date = "30NOV2018"d ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which will compare DATE to a date literal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So change your code to generate that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if date = "&amp;amp;month_end"d ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2019 16:44:35 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-12-11T16:44:35Z</dc:date>
    <item>
      <title>SAS error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-message/m-p/611063#M178043</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please can someone help to resolve the error in my Log? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Code&lt;/U&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set RA.DATA_V_&amp;amp;START_yyyy.;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if date = &amp;amp;month_end.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Log&lt;/U&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;27 set RA.DATA_V_&amp;amp;START_yyyy.;&lt;BR /&gt;28 if date = &amp;amp;month_end.;&lt;BR /&gt;NOTE: Line generated by the macro variable "MONTH_END".&lt;BR /&gt;28 30NOV2018&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_______&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;22&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +, -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, EQ, GE, GT, IN,&lt;BR /&gt;LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=, |, ||, ~=.&lt;/P&gt;&lt;P&gt;29 run;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 16:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-message/m-p/611063#M178043</guid>
      <dc:creator>jeremy4</dc:creator>
      <dc:date>2019-12-11T16:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-message/m-p/611064#M178044</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   set RA.DATA_V_&amp;amp;START_yyyy.;
   if date = "&amp;amp;month_end.";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;enclose in double quotes. This assumes your data is character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If numeric, you need a date constant like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   set RA.DATA_V_&amp;amp;START_yyyy.;
   if date = "&amp;amp;month_end."d;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 16:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-message/m-p/611064#M178044</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-11T16:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-message/m-p/611067#M178046</link>
      <description>&lt;P&gt;I take it that "date" is a SAS date variable, so you need to make a SAS date literal out of your string:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   set RA.DATA_V_&amp;amp;START_yyyy.;
   if date = "&amp;amp;month_end."d;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You would not need this if you had stored the raw value in your macro variable, see Maxim 28.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 16:42:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-message/m-p/611067#M178046</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-11T16:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-message/m-p/611068#M178047</link>
      <description>&lt;P&gt;You tried to run this statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if date = 30NOV2018 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That is not valid syntax.&amp;nbsp; SAS is expecting a valid expression on the right of the equal sign. What you gave it is not a valie varaible name nor a number nor a character string.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely you intended to run this statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if date = "30NOV2018"d ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which will compare DATE to a date literal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So change your code to generate that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if date = "&amp;amp;month_end"d ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 16:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-message/m-p/611068#M178047</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-12-11T16:44:35Z</dc:date>
    </item>
  </channel>
</rss>

