<?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 message in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/re-error-message/m-p/273958#M54608</link>
    <description>&lt;P&gt;Hi...I am trying to do a loop from one date to another but I am getting the following error message 22-322...any suggestions how to correct this...Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;269 DATA K;&lt;/P&gt;
&lt;P&gt;270 do date=&amp;amp;FROMYEAR7 to &amp;amp;TOYEAR7;&lt;/P&gt;
&lt;P&gt;NOTE: Line generated by the macro variable "FROMYEAR7".&lt;/P&gt;
&lt;P&gt;270 01JAN1900&lt;/P&gt;
&lt;P&gt;_______&lt;/P&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;P&gt;NOTE: Line generated by the macro variable "TOYEAR7".&lt;/P&gt;
&lt;P&gt;270 31DEC2100&lt;/P&gt;
&lt;P&gt;_______&lt;/P&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +, ',', -,&lt;/P&gt;
&lt;P&gt;/, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, BY, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE,&lt;/P&gt;
&lt;P&gt;NG, NL, NOTIN, OR, ^=, |, ||, ~=.&lt;/P&gt;
&lt;P&gt;271 if date= &amp;amp;FROMYEAR7 then do;&lt;/P&gt;
&lt;P&gt;NOTE: Line generated by the macro variable "FROMYEAR7".&lt;/P&gt;
&lt;P&gt;271 01JAN1900&lt;/P&gt;
&lt;P&gt;_______&lt;/P&gt;
&lt;P&gt;388&lt;/P&gt;
&lt;P&gt;76&lt;/P&gt;
&lt;P&gt;ERROR 388-185: Expecting an arithmetic operator.&lt;/P&gt;
&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 May 2016 19:01:27 GMT</pubDate>
    <dc:creator>twildone</dc:creator>
    <dc:date>2016-05-30T19:01:27Z</dc:date>
    <item>
      <title>re: error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-error-message/m-p/273958#M54608</link>
      <description>&lt;P&gt;Hi...I am trying to do a loop from one date to another but I am getting the following error message 22-322...any suggestions how to correct this...Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;269 DATA K;&lt;/P&gt;
&lt;P&gt;270 do date=&amp;amp;FROMYEAR7 to &amp;amp;TOYEAR7;&lt;/P&gt;
&lt;P&gt;NOTE: Line generated by the macro variable "FROMYEAR7".&lt;/P&gt;
&lt;P&gt;270 01JAN1900&lt;/P&gt;
&lt;P&gt;_______&lt;/P&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;P&gt;NOTE: Line generated by the macro variable "TOYEAR7".&lt;/P&gt;
&lt;P&gt;270 31DEC2100&lt;/P&gt;
&lt;P&gt;_______&lt;/P&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +, ',', -,&lt;/P&gt;
&lt;P&gt;/, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, BY, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE,&lt;/P&gt;
&lt;P&gt;NG, NL, NOTIN, OR, ^=, |, ||, ~=.&lt;/P&gt;
&lt;P&gt;271 if date= &amp;amp;FROMYEAR7 then do;&lt;/P&gt;
&lt;P&gt;NOTE: Line generated by the macro variable "FROMYEAR7".&lt;/P&gt;
&lt;P&gt;271 01JAN1900&lt;/P&gt;
&lt;P&gt;_______&lt;/P&gt;
&lt;P&gt;388&lt;/P&gt;
&lt;P&gt;76&lt;/P&gt;
&lt;P&gt;ERROR 388-185: Expecting an arithmetic operator.&lt;/P&gt;
&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2016 19:01:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-error-message/m-p/273958#M54608</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2016-05-30T19:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: re: error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-error-message/m-p/273964#M54611</link>
      <description>&lt;P&gt;Hi mate,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is possible that you missed out some operator during your do loop. Checkout the syntax and paste the code here if possible&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tks&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2016 19:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-error-message/m-p/273964#M54611</guid>
      <dc:creator>DartRodrigo</dc:creator>
      <dc:date>2016-05-30T19:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: re: error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-error-message/m-p/273965#M54612</link>
      <description>&lt;P&gt;Since your macro variables resolve to SAS dates you need to reference them as date strings like so (assuming the date variable is in fact a SAS date):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;do date="&amp;amp;FROMYEAR7"d to "&amp;amp;TOYEAR7"d;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2016 19:31:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-error-message/m-p/273965#M54612</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-05-30T19:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: re: error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-error-message/m-p/273966#M54613</link>
      <description>Hi:&lt;BR /&gt;  Without seeing more of your code, it looks to me like you need to specify date constants in your do loop:&lt;BR /&gt;do date="&amp;amp;FROMYEAR7"d to "&amp;amp;TOYEAR7"d;&lt;BR /&gt;&lt;BR /&gt;Please review this example: &lt;A href="http://support.sas.com/kb/24/573.html" target="_blank"&gt;http://support.sas.com/kb/24/573.html&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;When you are using Macro variables as the start and end variables, you need to enclose your macro variable values in double quotes (instead of single quotes), but the trailing D to indicate a date value is required. Otherwise, you get an error because this:&lt;BR /&gt;&lt;BR /&gt;do date=01JAN1900 to 31DEC2100; &lt;BR /&gt;&lt;BR /&gt;is not valid in code, but this would be:&lt;BR /&gt;&lt;BR /&gt;data testit;&lt;BR /&gt;do date="01JAN1900"d to "31DEC2100"d; &lt;BR /&gt;  put 'internal= ' date '~~~' 'formatted= ' date date9.;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Mon, 30 May 2016 19:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-error-message/m-p/273966#M54613</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-05-30T19:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: re: error message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-error-message/m-p/273990#M54624</link>
      <description>Hi...thanks....the double quotation marks rather than the single quotation marks resolved the problem and worked perfectly.</description>
      <pubDate>Tue, 31 May 2016 00:04:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-error-message/m-p/273990#M54624</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2016-05-31T00:04:22Z</dc:date>
    </item>
  </channel>
</rss>

