<?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: The macro doesn't contain a DO loop. How does it loop in below example? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/The-macro-doesn-t-contain-a-DO-loop-How-does-it-loop-in-below/m-p/898925#M40022</link>
    <description>&lt;P&gt;Curious which class this is from, can you share?&amp;nbsp; I don't see a lot of recursive macros.&amp;nbsp; I would consider it an advanced topic for the macro language (but I guess would be included in an introductory class for many languages).&lt;/P&gt;</description>
    <pubDate>Tue, 17 Oct 2023 13:59:03 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2023-10-17T13:59:03Z</dc:date>
    <item>
      <title>The macro doesn't contain a DO loop. How does it loop in below example?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/The-macro-doesn-t-contain-a-DO-loop-How-does-it-loop-in-below/m-p/898911#M40019</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="POOJA_J_0-1697546347258.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88909i001073BF377E7FF9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="POOJA_J_0-1697546347258.png" alt="POOJA_J_0-1697546347258.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I cam across one of this MCQ's.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro doesn't have a DO loop so how does it create values of 3,2,1?&lt;/P&gt;
&lt;P&gt;Plz explain the logic working behind this.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 12:41:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/The-macro-doesn-t-contain-a-DO-loop-How-does-it-loop-in-below/m-p/898911#M40019</guid>
      <dc:creator>POOJA_J</dc:creator>
      <dc:date>2023-10-17T12:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: The macro doesn't contain a DO loop. How does it loop in below example?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/The-macro-doesn-t-contain-a-DO-loop-How-does-it-loop-in-below/m-p/898914#M40020</link>
      <description>&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/Recursion" target="_blank"&gt;https://en.wikipedia.org/wiki/Recursion&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 12:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/The-macro-doesn-t-contain-a-DO-loop-How-does-it-loop-in-below/m-p/898914#M40020</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-10-17T12:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: The macro doesn't contain a DO loop. How does it loop in below example?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/The-macro-doesn-t-contain-a-DO-loop-How-does-it-loop-in-below/m-p/898921#M40021</link>
      <description>&lt;P&gt;The "magic" is in the first line. The %EVAL macro will evaluate it's argument when the code is run.&lt;/P&gt;
&lt;P&gt;So when n=4, the first line evaluates to&amp;nbsp;&lt;BR /&gt;%EVAL( 4 + %mysum(3) ).&lt;/P&gt;
&lt;P&gt;This causes the %MYSUM macro to be run with a new argument. This time the first line evaluates to (dropping the %EVAL call, for convenience)&lt;BR /&gt;3 +&amp;nbsp;%mysum(2).&lt;/P&gt;
&lt;P&gt;This continues recursively until the argument n=1, in which case the macro generates&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;Cumulatively, the macro generates an expression that is equivalent to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%EVAL(4 + %EVAL(3 + %EVAL(2 + 1)))&lt;BR /&gt;which is displayed in the log by using the %PUT call.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 13:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/The-macro-doesn-t-contain-a-DO-loop-How-does-it-loop-in-below/m-p/898921#M40021</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-10-17T13:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: The macro doesn't contain a DO loop. How does it loop in below example?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/The-macro-doesn-t-contain-a-DO-loop-How-does-it-loop-in-below/m-p/898925#M40022</link>
      <description>&lt;P&gt;Curious which class this is from, can you share?&amp;nbsp; I don't see a lot of recursive macros.&amp;nbsp; I would consider it an advanced topic for the macro language (but I guess would be included in an introductory class for many languages).&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 13:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/The-macro-doesn-t-contain-a-DO-loop-How-does-it-loop-in-below/m-p/898925#M40022</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-10-17T13:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: The macro doesn't contain a DO loop. How does it loop in below example?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/The-macro-doesn-t-contain-a-DO-loop-How-does-it-loop-in-below/m-p/898933#M40023</link>
      <description>I searched in google - MCQ questions for Advanced SAS certification.</description>
      <pubDate>Tue, 17 Oct 2023 14:18:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/The-macro-doesn-t-contain-a-DO-loop-How-does-it-loop-in-below/m-p/898933#M40023</guid>
      <dc:creator>POOJA_J</dc:creator>
      <dc:date>2023-10-17T14:18:35Z</dc:date>
    </item>
  </channel>
</rss>

