<?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: Last Iteration of do/end not resolving in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Last-Iteration-of-do-end-not-resolving/m-p/921417#M362871</link>
    <description>&lt;P&gt;For one thing you create a pile of macro variables and do not assign any values to them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One suspects that the macro variable Value_4_4 was created earlier, with different code, in such a manner that it appears in the GLOBAL table. Since the approach you are using with %dummy does not place the variable into the global table it is local and stops existing when the macro ends. Since we had a similar question from you earlier you might want to be aware that CALL SYMPUTX by default places everything into the global macro variable table.&lt;/P&gt;
&lt;P&gt;Test whether other variables were earlier placed in the global table with:&lt;/P&gt;
&lt;PRE&gt;%put _global_;&lt;/PRE&gt;
&lt;P&gt;Depending on what you have done prior you might examine &amp;amp;value_1_8, &amp;amp;value_2_8 etc. I suspect you may find all of them undefined as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FWIW, I get the same Unresolved note about Value_4_4 (because I haven't run any code that placed it into the global table.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2024 22:10:59 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-03-21T22:10:59Z</dc:date>
    <item>
      <title>Last Iteration of do/end not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Last-Iteration-of-do-end-not-resolving/m-p/921406#M362862</link>
      <description>&lt;P&gt;I have this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;options symbolgen mprint mlogic;
%let cnt_id_groups=5;
%let cnt_Id_value_groups=8;
%macro dummy;
%do i = 1 %to &amp;amp;cnt_id_groups.;
	%do j=1 %to &amp;amp;cnt_Id_value_groups.;
		%let value_&amp;amp;i._&amp;amp;j=;
	%end;
%end;
%mend dummy;
%dummy;
%PUT VALUE_4_4=&amp;amp;VALUE_4_4;
%PUT VALUE_5_8=&amp;amp;VALUE_5_8;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Why would i not get the value for macro -- value_5_8?&lt;BR /&gt;what should i do?&lt;BR /&gt;&lt;BR /&gt;Here is the log:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;28         options symbolgen mprint mlogic;
29         %let cnt_id_groups=5;
30         %let cnt_Id_value_groups=8;
31         %macro dummy;
32         %do i = 1 %to &amp;amp;cnt_id_groups.;
33         	%do j=1 %to &amp;amp;cnt_Id_value_groups.;
34         		%let value_&amp;amp;i._&amp;amp;j=;
35         	%end;
36         %end;
37         %mend dummy;
38         %dummy;
MLOGIC(DUMMY):  Beginning execution.
SYMBOLGEN:  Macro variable CNT_ID_GROUPS resolves to 5
MLOGIC(DUMMY):  %DO loop beginning; index variable I; start value is 1; stop value is 5; by value is 1.  
SYMBOLGEN:  Macro variable CNT_ID_VALUE_GROUPS resolves to 8
MLOGIC(DUMMY):  %DO loop beginning; index variable J; start value is 1; stop value is 8; by value is 1.  
SYMBOLGEN:  Macro variable I resolves to 1
SYMBOLGEN:  Macro variable J resolves to 1
MLOGIC(DUMMY):  %LET (variable name is VALUE_1_1)
MLOGIC(DUMMY):  %DO loop index variable J is now 2; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 1
SYMBOLGEN:  Macro variable J resolves to 2
MLOGIC(DUMMY):  %LET (variable name is VALUE_1_2)
MLOGIC(DUMMY):  %DO loop index variable J is now 3; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 1
SYMBOLGEN:  Macro variable J resolves to 3
MLOGIC(DUMMY):  %LET (variable name is VALUE_1_3)
MLOGIC(DUMMY):  %DO loop index variable J is now 4; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 1
SYMBOLGEN:  Macro variable J resolves to 4
MLOGIC(DUMMY):  %LET (variable name is VALUE_1_4)
MLOGIC(DUMMY):  %DO loop index variable J is now 5; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 1
SYMBOLGEN:  Macro variable J resolves to 5
MLOGIC(DUMMY):  %LET (variable name is VALUE_1_5)
MLOGIC(DUMMY):  %DO loop index variable J is now 6; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 1
SYMBOLGEN:  Macro variable J resolves to 6
MLOGIC(DUMMY):  %LET (variable name is VALUE_1_6)
MLOGIC(DUMMY):  %DO loop index variable J is now 7; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 1
SYMBOLGEN:  Macro variable J resolves to 7
MLOGIC(DUMMY):  %LET (variable name is VALUE_1_7)
MLOGIC(DUMMY):  %DO loop index variable J is now 8; loop will iterate again.
3                                                          The SAS System                             09:54 Thursday, March 21, 2024

SYMBOLGEN:  Macro variable I resolves to 1
SYMBOLGEN:  Macro variable J resolves to 8
MLOGIC(DUMMY):  %LET (variable name is VALUE_1_8)
MLOGIC(DUMMY):  %DO loop index variable J is now 9; loop will not iterate again.
MLOGIC(DUMMY):  %DO loop index variable I is now 2; loop will iterate again.
SYMBOLGEN:  Macro variable CNT_ID_VALUE_GROUPS resolves to 8
MLOGIC(DUMMY):  %DO loop beginning; index variable J; start value is 1; stop value is 8; by value is 1.  
SYMBOLGEN:  Macro variable I resolves to 2
SYMBOLGEN:  Macro variable J resolves to 1
MLOGIC(DUMMY):  %LET (variable name is VALUE_2_1)
MLOGIC(DUMMY):  %DO loop index variable J is now 2; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 2
SYMBOLGEN:  Macro variable J resolves to 2
MLOGIC(DUMMY):  %LET (variable name is VALUE_2_2)
MLOGIC(DUMMY):  %DO loop index variable J is now 3; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 2
SYMBOLGEN:  Macro variable J resolves to 3
MLOGIC(DUMMY):  %LET (variable name is VALUE_2_3)
MLOGIC(DUMMY):  %DO loop index variable J is now 4; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 2
SYMBOLGEN:  Macro variable J resolves to 4
MLOGIC(DUMMY):  %LET (variable name is VALUE_2_4)
MLOGIC(DUMMY):  %DO loop index variable J is now 5; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 2
SYMBOLGEN:  Macro variable J resolves to 5
MLOGIC(DUMMY):  %LET (variable name is VALUE_2_5)
MLOGIC(DUMMY):  %DO loop index variable J is now 6; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 2
SYMBOLGEN:  Macro variable J resolves to 6
MLOGIC(DUMMY):  %LET (variable name is VALUE_2_6)
MLOGIC(DUMMY):  %DO loop index variable J is now 7; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 2
SYMBOLGEN:  Macro variable J resolves to 7
MLOGIC(DUMMY):  %LET (variable name is VALUE_2_7)
MLOGIC(DUMMY):  %DO loop index variable J is now 8; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 2
SYMBOLGEN:  Macro variable J resolves to 8
MLOGIC(DUMMY):  %LET (variable name is VALUE_2_8)
MLOGIC(DUMMY):  %DO loop index variable J is now 9; loop will not iterate again.
MLOGIC(DUMMY):  %DO loop index variable I is now 3; loop will iterate again.
SYMBOLGEN:  Macro variable CNT_ID_VALUE_GROUPS resolves to 8
MLOGIC(DUMMY):  %DO loop beginning; index variable J; start value is 1; stop value is 8; by value is 1.  
SYMBOLGEN:  Macro variable I resolves to 3
SYMBOLGEN:  Macro variable J resolves to 1
MLOGIC(DUMMY):  %LET (variable name is VALUE_3_1)
MLOGIC(DUMMY):  %DO loop index variable J is now 2; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 3
SYMBOLGEN:  Macro variable J resolves to 2
MLOGIC(DUMMY):  %LET (variable name is VALUE_3_2)
MLOGIC(DUMMY):  %DO loop index variable J is now 3; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 3
SYMBOLGEN:  Macro variable J resolves to 3
MLOGIC(DUMMY):  %LET (variable name is VALUE_3_3)
MLOGIC(DUMMY):  %DO loop index variable J is now 4; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 3
SYMBOLGEN:  Macro variable J resolves to 4
MLOGIC(DUMMY):  %LET (variable name is VALUE_3_4)
MLOGIC(DUMMY):  %DO loop index variable J is now 5; loop will iterate again.
4                                                          The SAS System                             09:54 Thursday, March 21, 2024

SYMBOLGEN:  Macro variable I resolves to 3
SYMBOLGEN:  Macro variable J resolves to 5
MLOGIC(DUMMY):  %LET (variable name is VALUE_3_5)
MLOGIC(DUMMY):  %DO loop index variable J is now 6; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 3
SYMBOLGEN:  Macro variable J resolves to 6
MLOGIC(DUMMY):  %LET (variable name is VALUE_3_6)
MLOGIC(DUMMY):  %DO loop index variable J is now 7; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 3
SYMBOLGEN:  Macro variable J resolves to 7
MLOGIC(DUMMY):  %LET (variable name is VALUE_3_7)
MLOGIC(DUMMY):  %DO loop index variable J is now 8; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 3
SYMBOLGEN:  Macro variable J resolves to 8
MLOGIC(DUMMY):  %LET (variable name is VALUE_3_8)
MLOGIC(DUMMY):  %DO loop index variable J is now 9; loop will not iterate again.
MLOGIC(DUMMY):  %DO loop index variable I is now 4; loop will iterate again.
SYMBOLGEN:  Macro variable CNT_ID_VALUE_GROUPS resolves to 8
MLOGIC(DUMMY):  %DO loop beginning; index variable J; start value is 1; stop value is 8; by value is 1.  
SYMBOLGEN:  Macro variable I resolves to 4
SYMBOLGEN:  Macro variable J resolves to 1
MLOGIC(DUMMY):  %LET (variable name is VALUE_4_1)
MLOGIC(DUMMY):  %DO loop index variable J is now 2; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 4
SYMBOLGEN:  Macro variable J resolves to 2
MLOGIC(DUMMY):  %LET (variable name is VALUE_4_2)
MLOGIC(DUMMY):  %DO loop index variable J is now 3; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 4
SYMBOLGEN:  Macro variable J resolves to 3
MLOGIC(DUMMY):  %LET (variable name is VALUE_4_3)
MLOGIC(DUMMY):  %DO loop index variable J is now 4; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 4
SYMBOLGEN:  Macro variable J resolves to 4
MLOGIC(DUMMY):  %LET (variable name is VALUE_4_4)
MLOGIC(DUMMY):  %DO loop index variable J is now 5; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 4
SYMBOLGEN:  Macro variable J resolves to 5
MLOGIC(DUMMY):  %LET (variable name is VALUE_4_5)
MLOGIC(DUMMY):  %DO loop index variable J is now 6; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 4
SYMBOLGEN:  Macro variable J resolves to 6
MLOGIC(DUMMY):  %LET (variable name is VALUE_4_6)
MLOGIC(DUMMY):  %DO loop index variable J is now 7; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 4
SYMBOLGEN:  Macro variable J resolves to 7
MLOGIC(DUMMY):  %LET (variable name is VALUE_4_7)
MLOGIC(DUMMY):  %DO loop index variable J is now 8; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 4
SYMBOLGEN:  Macro variable J resolves to 8
MLOGIC(DUMMY):  %LET (variable name is VALUE_4_8)
MLOGIC(DUMMY):  %DO loop index variable J is now 9; loop will not iterate again.
MLOGIC(DUMMY):  %DO loop index variable I is now 5; loop will iterate again.
SYMBOLGEN:  Macro variable CNT_ID_VALUE_GROUPS resolves to 8
MLOGIC(DUMMY):  %DO loop beginning; index variable J; start value is 1; stop value is 8; by value is 1.  
SYMBOLGEN:  Macro variable I resolves to 5
SYMBOLGEN:  Macro variable J resolves to 1
MLOGIC(DUMMY):  %LET (variable name is VALUE_5_1)
MLOGIC(DUMMY):  %DO loop index variable J is now 2; loop will iterate again.
5                                                          The SAS System                             09:54 Thursday, March 21, 2024

SYMBOLGEN:  Macro variable I resolves to 5
SYMBOLGEN:  Macro variable J resolves to 2
MLOGIC(DUMMY):  %LET (variable name is VALUE_5_2)
MLOGIC(DUMMY):  %DO loop index variable J is now 3; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 5
SYMBOLGEN:  Macro variable J resolves to 3
MLOGIC(DUMMY):  %LET (variable name is VALUE_5_3)
MLOGIC(DUMMY):  %DO loop index variable J is now 4; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 5
SYMBOLGEN:  Macro variable J resolves to 4
MLOGIC(DUMMY):  %LET (variable name is VALUE_5_4)
MLOGIC(DUMMY):  %DO loop index variable J is now 5; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 5
SYMBOLGEN:  Macro variable J resolves to 5
MLOGIC(DUMMY):  %LET (variable name is VALUE_5_5)
MLOGIC(DUMMY):  %DO loop index variable J is now 6; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 5
SYMBOLGEN:  Macro variable J resolves to 6
MLOGIC(DUMMY):  %LET (variable name is VALUE_5_6)
MLOGIC(DUMMY):  %DO loop index variable J is now 7; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 5
SYMBOLGEN:  Macro variable J resolves to 7
MLOGIC(DUMMY):  %LET (variable name is VALUE_5_7)
MLOGIC(DUMMY):  %DO loop index variable J is now 8; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 5
SYMBOLGEN:  Macro variable J resolves to 8
MLOGIC(DUMMY):  %LET (variable name is VALUE_5_8)
MLOGIC(DUMMY):  %DO loop index variable J is now 9; loop will not iterate again.
MLOGIC(DUMMY):  %DO loop index variable I is now 6; loop will not iterate again.
MLOGIC(DUMMY):  Ending execution.
39         %PUT VALUE_4_4=&amp;amp;VALUE_4_4;
SYMBOLGEN:  Macro variable VALUE_4_4 resolves to 
VALUE_4_4=
40         %PUT VALUE_5_8=&amp;amp;VALUE_5_8;
&lt;STRONG&gt;WARNING: Apparent symbolic reference VALUE_5_8 not resolved.&lt;/STRONG&gt;
VALUE_5_8=&amp;amp;VALUE_5_8&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Mar 2024 20:58:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Last-Iteration-of-do-end-not-resolving/m-p/921406#M362862</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2024-03-21T20:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Last Iteration of do/end not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Last-Iteration-of-do-end-not-resolving/m-p/921410#M362866</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Why would i not&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt; the value for macro -- value_5_8?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This macro variable was created inside the macro and is not defined outside the macro. You could include a %GLOBAL command inside the macro.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; %global value_5_8;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, this looks like a overly complicated use of the macro language, and I bet there a much simpler ways to go. Please describe why you doing this, in words, at a high level so that your boss's boss would understand the project, and please tell us in words what would you do with these macro variables after they are created.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 21:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Last-Iteration-of-do-end-not-resolving/m-p/921410#M362866</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-03-21T21:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Last Iteration of do/end not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Last-Iteration-of-do-end-not-resolving/m-p/921417#M362871</link>
      <description>&lt;P&gt;For one thing you create a pile of macro variables and do not assign any values to them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One suspects that the macro variable Value_4_4 was created earlier, with different code, in such a manner that it appears in the GLOBAL table. Since the approach you are using with %dummy does not place the variable into the global table it is local and stops existing when the macro ends. Since we had a similar question from you earlier you might want to be aware that CALL SYMPUTX by default places everything into the global macro variable table.&lt;/P&gt;
&lt;P&gt;Test whether other variables were earlier placed in the global table with:&lt;/P&gt;
&lt;PRE&gt;%put _global_;&lt;/PRE&gt;
&lt;P&gt;Depending on what you have done prior you might examine &amp;amp;value_1_8, &amp;amp;value_2_8 etc. I suspect you may find all of them undefined as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FWIW, I get the same Unresolved note about Value_4_4 (because I haven't run any code that placed it into the global table.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 22:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Last-Iteration-of-do-end-not-resolving/m-p/921417#M362871</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-03-21T22:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Last Iteration of do/end not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Last-Iteration-of-do-end-not-resolving/m-p/921436#M362885</link>
      <description>&lt;P&gt;You need to populate your macro variables AND you need to define it as %global if you want to use it outside of your macro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope below will give you some guidance.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let cnt_id_groups=5;
%let cnt_Id_value_groups=9;
%macro dummy;
  %global value_&amp;amp;cnt_id_groups._&amp;amp;cnt_Id_value_groups;
  %do i = 1 %to &amp;amp;cnt_id_groups.;
  	%do j=1 %to &amp;amp;cnt_Id_value_groups.;
  		%let value_&amp;amp;i._&amp;amp;j=%eval(&amp;amp;i * &amp;amp;j);
  	%end;
  %end;
  %put last_iter_macro var name:  value_&amp;amp;cnt_id_groups._&amp;amp;cnt_Id_value_groups;
  %put last_iter_macro var value: &amp;amp;&amp;amp;value_&amp;amp;cnt_id_groups._&amp;amp;cnt_Id_value_groups;
%mend dummy;
%dummy;

%put value_&amp;amp;cnt_id_groups._&amp;amp;cnt_Id_value_groups: &amp;amp;&amp;amp;value_&amp;amp;cnt_id_groups._&amp;amp;cnt_Id_value_groups;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1711075516967.png" style="width: 866px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94861i7147E2CA4B953FC6/image-dimensions/866x133?v=v2" width="866" height="133" role="button" title="Patrick_0-1711075516967.png" alt="Patrick_0-1711075516967.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 02:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Last-Iteration-of-do-end-not-resolving/m-p/921436#M362885</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-03-22T02:45:59Z</dc:date>
    </item>
  </channel>
</rss>

