<?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: Practice Macro Essentials   What does this mean? ERROR: Open code state recursion detected in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957136#M11372</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/397947"&gt;@heatherml20&lt;/a&gt;, I noticed that you're missing semicolons after some of your %PUT statements.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put &amp;amp;=First&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That can cause the errors you're encountering. Try going through your code, add all of the required semicolons to end each statement and rerun.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jan 2025 15:50:42 GMT</pubDate>
    <dc:creator>antonbcristina</dc:creator>
    <dc:date>2025-01-24T15:50:42Z</dc:date>
    <item>
      <title>Practice Macro Essentials   What does this mean? ERROR: Open code state recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957132#M11371</link>
      <description>&lt;DIV class=""&gt;* Macro Functions: Practice #1 *&lt;/DIV&gt;&lt;DIV class=""&gt;75 *******************************/&lt;/DIV&gt;&lt;DIV class=""&gt;76&lt;/DIV&gt;&lt;DIV class=""&gt;77 %let Fullname=AnTHoNY MilLeR;&lt;/DIV&gt;&lt;DIV class=""&gt;78 %Let First=%scan(&amp;amp;fullname, 1);&lt;/DIV&gt;&lt;DIV class=""&gt;79 %Let Last=%scan(&amp;amp;fullname, 2);&lt;/DIV&gt;&lt;DIV class=""&gt;80&lt;/DIV&gt;&lt;DIV class=""&gt;81 %put &amp;amp;=First&lt;/DIV&gt;&lt;DIV class=""&gt;82&lt;/DIV&gt;&lt;DIV class=""&gt;83 %put %sysfunc(propcase(&amp;amp;First));&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Open code statement recursion detected.&lt;/DIV&gt;&lt;DIV class=""&gt;84&lt;/DIV&gt;&lt;DIV class=""&gt;85 %put &amp;amp;=Last&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Open code statement recursion detected.&lt;/DIV&gt;&lt;DIV class=""&gt;86&lt;/DIV&gt;&lt;DIV class=""&gt;87 %put %sysfunc(propcase(&amp;amp;Last));&lt;/DIV&gt;&lt;DIV class=""&gt;88&lt;/DIV&gt;&lt;DIV class=""&gt;89 %put Fullname=&amp;amp;Fullname First=%sysfunc(propcase(&amp;amp;First)) Last=%sysfunc(propcase(&amp;amp;Last));&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Open code statement recursion detected.&lt;/DIV&gt;&lt;DIV class=""&gt;90&lt;/DIV&gt;&lt;DIV class=""&gt;91 %put &amp;amp;Fullname;&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Open code statement recursion detected.&lt;/DIV&gt;&lt;DIV class=""&gt;92&lt;/DIV&gt;&lt;DIV class=""&gt;93 %put %upcase(&amp;amp;fullname);&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Open code statement recursion detected.&lt;/DIV&gt;&lt;DIV class=""&gt;94&lt;/DIV&gt;&lt;DIV class=""&gt;95 %put The current form of the name is &amp;amp;Fullname and the Propercase is&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Open code statement recursion detected.&lt;/DIV&gt;&lt;DIV class=""&gt;96 %sysfunc(propcase(&amp;amp;Fullname));&lt;/DIV&gt;&lt;DIV class=""&gt;97&lt;/DIV&gt;&lt;DIV class=""&gt;98 %put _user_;&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Open code statement recursion detected.&lt;/DIV&gt;&lt;DIV class=""&gt;99&lt;/DIV&gt;&lt;DIV class=""&gt;100 %symdel Fullname ;&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Open code statement recursion detected.&lt;/DIV&gt;&lt;DIV class=""&gt;101&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Jan 2025 15:40:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957132#M11371</guid>
      <dc:creator>heatherml20</dc:creator>
      <dc:date>2025-01-24T15:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Practice Macro Essentials   What does this mean? ERROR: Open code state recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957136#M11372</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/397947"&gt;@heatherml20&lt;/a&gt;, I noticed that you're missing semicolons after some of your %PUT statements.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put &amp;amp;=First&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That can cause the errors you're encountering. Try going through your code, add all of the required semicolons to end each statement and rerun.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 15:50:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957136#M11372</guid>
      <dc:creator>antonbcristina</dc:creator>
      <dc:date>2025-01-24T15:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Practice Macro Essentials   What does this mean? ERROR: Open code state recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957143#M11373</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/84234"&gt;@antonbcristina&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Try going through your code, add all of the required semicolons to end each statement and rerun.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;... and before you rerun the statements which failed, &lt;EM&gt;submit the two missing semicolons alone&lt;/EM&gt;. This should get the macro processor out of that "statement recursion" mode.&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;;;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jan 2025 16:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957143#M11373</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2025-01-24T16:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Practice Macro Essentials What does this mean? ERROR: Open code state recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957144#M11374</link>
      <description>I did that but I also did not use a %mend statement. I think that is the&lt;BR /&gt;error.&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Jan 2025 16:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957144#M11374</guid>
      <dc:creator>heatherml20</dc:creator>
      <dc:date>2025-01-24T16:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Practice Macro Essentials What does this mean? ERROR: Open code state recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957145#M11375</link>
      <description>&lt;P&gt;A %MEND statement would end the definition of a &lt;EM&gt;SAS macro&lt;/EM&gt; (starting with a %MACRO statement -- which is neither shown in your log, nor required for the %LET, %PUT and %SYMDEL statements to work).&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 16:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957145#M11375</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2025-01-24T16:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Practice Macro Essentials What does this mean? ERROR: Open code state recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957146#M11376</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Yes, I found that I missed a couple of semicolons. I appreciate your&lt;BR /&gt;help. The main problem is that I did not use a %Mend statement at the end&lt;BR /&gt;of the Macro definition.&lt;BR /&gt;&lt;BR /&gt;How do I use a %symdel statement to delete variables from the global symbol&lt;BR /&gt;table? How do I show the variables in the table itself?&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Jan 2025 16:19:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957146#M11376</guid>
      <dc:creator>heatherml20</dc:creator>
      <dc:date>2025-01-24T16:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Practice Macro Essentials What does this mean? ERROR: Open code state recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957147#M11377</link>
      <description>&lt;P&gt;Usually you don't need to delete macro variables.&amp;nbsp; They will disappear when your current SAS session ends.&amp;nbsp; But to delete macro variable just list its name in the %SYMDEL statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%symdel x;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To see what is in the GLOBAL symbol table you can use special keyword _GLOBAL_ with the %PUT statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put _global_;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Example::&lt;/P&gt;
&lt;PRE&gt;1    %let x=101;
2    %let y=102;
3    %put _global_;
GLOBAL X 101
GLOBAL Y 102
4    %symdel x ;
5    %put _global_;
GLOBAL Y 102
&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jan 2025 16:27:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957147#M11377</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-01-24T16:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Practice Macro Essentials What does this mean? ERROR: Open code state recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957148#M11378</link>
      <description>&lt;P&gt;To display in the LOG all macro variables stored, you can use a %PUT statement with the keyword _ALL_ to display all macro variables or _USER_ to display user defined macro variables.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put _all_;&lt;BR /&gt;&lt;BR /&gt;%put&amp;nbsp;_user_;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To delete macro variables created, you can use the %SYMDEL statement with the name of the macro variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%symdel &amp;lt;macro_var_name&amp;gt;;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 16:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957148#M11378</guid>
      <dc:creator>antonbcristina</dc:creator>
      <dc:date>2025-01-24T16:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Practice Macro Essentials What does this mean? ERROR: Open code state recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957151#M11379</link>
      <description>&lt;P&gt;This is how your log would have looked like, had you submitted your code as part of a macro definition (using the macro name &lt;FONT face="courier new,courier"&gt;test&lt;/FONT&gt; for demonstration)&lt;FONT face="arial,helvetica,sans-serif"&gt;:&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;76    %macro test;
77      %let Fullname=AnTHoNY MilLeR;
78      %Let First=%scan(&amp;amp;fullname, 1);
79      %Let Last=%scan(&amp;amp;fullname, 2);
80
81      %put &amp;amp;=First
82
83      %put %sysfunc(propcase(&amp;amp;First));
&lt;FONT color="#FF0000"&gt;ERROR: Macro keyword PUT appears as text.
ERROR: A dummy macro will be compiled.&lt;/FONT&gt;
84
85      %put &amp;amp;=Last
86
87      %put %sysfunc(propcase(&amp;amp;Last));
&lt;FONT color="#FF0000"&gt;ERROR: Macro keyword PUT appears as text.&lt;/FONT&gt;
...&lt;/PRE&gt;
&lt;P&gt;But you did not show any of the above error messages, which indicates that you did &lt;EM&gt;not&lt;/EM&gt; submit a macro definition and hence don't need a %MEND statement.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 16:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957151#M11379</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2025-01-24T16:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Practice Macro Essentials What does this mean? ERROR: Open code state recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957180#M11380</link>
      <description>The mend statement did get rid of the ERROR: Open code state recursion&lt;BR /&gt;detected in this case.&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Jan 2025 20:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957180#M11380</guid>
      <dc:creator>heatherml20</dc:creator>
      <dc:date>2025-01-24T20:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Practice Macro Essentials What does this mean? ERROR: Open code state recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957196#M11381</link>
      <description>&lt;P&gt;Oh yes, you're right. The %MEND statement helps at least in this particular example (as does submitting the two forgotten semicolons) -- but not because it was missing in the first place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A %MEND statement is also part of the "magic" string that is recommended as a remedy in situations where the reason of the "open code statement recursion" is less obvious. The usage of this string&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*'; *"; *); */; %mend; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is documented in the section "&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n1rvuiao0okk6cn1afs9ckt2unh9.htm#n126moikd9s334n1p4nz2h3e17l9" target="_blank" rel="noopener"&gt;Solving Open Code Statement Recursion Problems&lt;/A&gt;" of the Macro Language Reference, together with other recommendations.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 22:26:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957196#M11381</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2025-01-24T22:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Practice Macro Essentials What does this mean? ERROR: Open code state recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957219#M11382</link>
      <description>Thank you Jade! I appreciate your help\\\ More to come as I am studying&lt;BR /&gt;for the Adv 9.4 programming now.&lt;BR /&gt;</description>
      <pubDate>Sat, 25 Jan 2025 08:05:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Practice-Macro-Essentials-What-does-this-mean-ERROR-Open-code/m-p/957219#M11382</guid>
      <dc:creator>heatherml20</dc:creator>
      <dc:date>2025-01-25T08:05:21Z</dc:date>
    </item>
  </channel>
</rss>

