<?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 Why doesnt decremental macro loop work? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-doesnt-decremental-macro-loop-work/m-p/162498#M31524</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing a %do loop with decreasing iterative value. But this doesn't work. Can anyone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro loop;&lt;/P&gt;&lt;P&gt;%do i=3 %to 1 by -1;&lt;/P&gt;&lt;P&gt;data b_&amp;amp;i.;&lt;/P&gt;&lt;P&gt;set a&amp;amp;i.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%loop;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: 1 by -1 &lt;/P&gt;&lt;P&gt;ERROR: The %TO value of the %DO I loop is invalid.&lt;/P&gt;&lt;P&gt;ERROR: The macro LOOP will stop executing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 27 Sep 2014 04:11:15 GMT</pubDate>
    <dc:creator>nravi</dc:creator>
    <dc:date>2014-09-27T04:11:15Z</dc:date>
    <item>
      <title>Why doesnt decremental macro loop work?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesnt-decremental-macro-loop-work/m-p/162498#M31524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing a %do loop with decreasing iterative value. But this doesn't work. Can anyone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro loop;&lt;/P&gt;&lt;P&gt;%do i=3 %to 1 by -1;&lt;/P&gt;&lt;P&gt;data b_&amp;amp;i.;&lt;/P&gt;&lt;P&gt;set a&amp;amp;i.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%loop;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: 1 by -1 &lt;/P&gt;&lt;P&gt;ERROR: The %TO value of the %DO I loop is invalid.&lt;/P&gt;&lt;P&gt;ERROR: The macro LOOP will stop executing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Sep 2014 04:11:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesnt-decremental-macro-loop-work/m-p/162498#M31524</guid>
      <dc:creator>nravi</dc:creator>
      <dc:date>2014-09-27T04:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesnt decremental macro loop work?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesnt-decremental-macro-loop-work/m-p/162499#M31525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use %by rather than just by in your do loop statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%macro loop;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%do i=3 %to 1 %by -1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data b_&amp;amp;i.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;set a&amp;amp;i.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%end;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%mend;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;%loop;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Sep 2014 04:35:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesnt-decremental-macro-loop-work/m-p/162499#M31525</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-27T04:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesnt decremental macro loop work?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-doesnt-decremental-macro-loop-work/m-p/162500#M31526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked. Thank you &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Sep 2014 04:59:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-doesnt-decremental-macro-loop-work/m-p/162500#M31526</guid>
      <dc:creator>nravi</dc:creator>
      <dc:date>2014-09-27T04:59:39Z</dc:date>
    </item>
  </channel>
</rss>

