<?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: How to remove the error 'Open code statement recursion detected in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550459#M152830</link>
    <description>I would expect to a %IF/%THEN or something else that may generate that but nothing in your code appears problematic. Run each line at a time to find the actual error.</description>
    <pubDate>Thu, 11 Apr 2019 22:48:22 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-04-11T22:48:22Z</dc:date>
    <item>
      <title>How to remove the error 'Open code statement recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550442#M152821</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a couple of macro variables in my SAS code which contains the list of variables. i.e.&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;%let&amp;nbsp; list1= var1 var2 var3 var4 ........ ;
%let list2= var10 var15 var60 ;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (few variables from list1)
%let&amp;nbsp; uplist1=%upcase(%str(&amp;amp;list1.));
%let&amp;nbsp; uplist2=%upcase(%str(&amp;amp;list2.));

&lt;/LI-CODE&gt;
&lt;P&gt;When I run the above code, I am getting the error Open code statement recursion detected'&lt;/P&gt;
&lt;P&gt;Is there any way to remove it, please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 16:25:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550442#M152821</guid>
      <dc:creator>Sami1234</dc:creator>
      <dc:date>2022-06-06T16:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove the error 'Open code statement recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550449#M152826</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/211980"&gt;@Sami1234&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This error indicates that you've got a syntax error somewhere in your macro code -&amp;nbsp; a missing semicolon for example. The code you've posted looks o.k. though.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 22:15:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550449#M152826</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-04-11T22:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove the error 'Open code statement recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550459#M152830</link>
      <description>I would expect to a %IF/%THEN or something else that may generate that but nothing in your code appears problematic. Run each line at a time to find the actual error.</description>
      <pubDate>Thu, 11 Apr 2019 22:48:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550459#M152830</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-04-11T22:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove the error 'Open code statement recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550470#M152835</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/211980"&gt;@Sami1234&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a couple of macro variables in my SAS code which contains the list of variables. i.e.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let&amp;nbsp; list1= var1 var2 var3 var4 ........ ;&lt;/P&gt;
&lt;P&gt;%let list2= var10 var15 var60 ;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (few varaibles from list1)&lt;/P&gt;
&lt;P&gt;%let&amp;nbsp; uplist1=%upcase(%str(&amp;amp;list1.));&lt;/P&gt;
&lt;P&gt;%let&amp;nbsp; uplist2=%upcase(%str(&amp;amp;list2.));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run the above code, I am getting the error Open code statement recursion detected'&lt;/P&gt;
&lt;P&gt;Is there any way to remove it, please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since the only reason you would need to use %str in&lt;/P&gt;
&lt;PRE&gt;%let  uplist1=%upcase(%str(&amp;amp;list1.));

%let  uplist2=%upcase(%str(&amp;amp;list2.));
&lt;/PRE&gt;
&lt;P&gt;would be the inclusion of special characters of some sort then perhaps you need to show the entire list of actual values for List1 and list2&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;%let list1= var1 var2 var3 var4 ........ ;

%let uplist1=%upcase(&amp;amp;list1.);

%put &amp;amp;uplist1.;&lt;/PRE&gt;
&lt;P&gt;As soon as you start placing other than simple text into your variable then the actual text matters, especially if it includes macro triggers like &amp;amp; or % (in which case you may need %NRSTR instead of %str)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that a missing ; on a let statement might be place to start as this will duplicate the error:&lt;/P&gt;
&lt;PRE&gt;2965  %let list1= var1 var2 var3 var4 ........
2966
2967  %let uplist1=%upcase(&amp;amp;list1.);
ERROR: Open code statement recursion detected.


&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Apr 2019 23:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550470#M152835</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-11T23:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove the error 'Open code statement recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550550#M152871</link>
      <description>&lt;P&gt;Thank you so much for your reply!&lt;/P&gt;&lt;P&gt;Actually, it's not throwing any error or warning now by using the following&amp;nbsp;code, running&amp;nbsp; within the macro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let&amp;nbsp; list1= var1 var2 var3 var4 ........ ;&lt;/P&gt;&lt;P&gt;%let list2= var10 var15 var60 ;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (few varaibles from list1)&lt;/P&gt;&lt;P&gt;%let&amp;nbsp; uplist1=%unquote(%upcase(%str(&amp;amp;list1.)));&lt;/P&gt;&lt;P&gt;%let&amp;nbsp; uplist2=%unquote(%upcase(%str(&amp;amp;list2.)));&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 09:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550550#M152871</guid>
      <dc:creator>Sami1234</dc:creator>
      <dc:date>2019-04-12T09:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove the error 'Open code statement recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550615#M152889</link>
      <description>So you now have all the clues you need to solve this.  I'll give you 30 minutes to work it out before I post again.</description>
      <pubDate>Fri, 12 Apr 2019 13:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550615#M152889</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-04-12T13:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove the error 'Open code statement recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550639#M152899</link>
      <description>When you ran the code originally, you ran it outside of any macros.  At the time, there were earlier SAS statements that had a missing semicolon.</description>
      <pubDate>Fri, 12 Apr 2019 13:58:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/550639#M152899</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-04-12T13:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove the error 'Open code statement recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/822059#M324579</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/211980"&gt;@Sami1234&lt;/a&gt; has nailed it.  At some point in your SAS session, the macro processor attempted to process what you thought was simple text, but to the processor, required resolution.  This is why in a new session you couldn't make the error appear from the code that was correct; most likely the "open" issue was created prior to that.&lt;BR /&gt;&lt;BR /&gt;Prior to 9.4 M5, %IF %THEN %ELSE was a common culprit of this, as it had to be inside a macro.  For information on this restriction being lifted, see &lt;A href="https://blogs.sas.com/content/sasdummy/2018/07/05/if-then-else-sas-programs/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2018/07/05/if-then-else-sas-programs/&lt;/A&gt;</description>
      <pubDate>Thu, 07 Jul 2022 13:48:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-the-error-Open-code-statement-recursion-detected/m-p/822059#M324579</guid>
      <dc:creator>carl_sommer</dc:creator>
      <dc:date>2022-07-07T13:48:21Z</dc:date>
    </item>
  </channel>
</rss>

