<?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: Storing a value of each iteration of do loop in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743310#M232696</link>
    <description>&lt;P&gt;Your pdf does not display in the preview.&lt;/P&gt;
&lt;P&gt;Please post code by copy/pasting the text into a window opened with the "little running man" button, and logs and other fixed-format text into a window opened with the &amp;lt;/&amp;gt; button.&lt;/P&gt;</description>
    <pubDate>Mon, 24 May 2021 07:45:08 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-05-24T07:45:08Z</dc:date>
    <item>
      <title>Storing a value of each iteration of do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743302#M232691</link>
      <description>I want to create a macro variable suffix1 suffix2... Suffix12 variable such that&lt;BR /&gt;suffix1= 11 12 13&lt;BR /&gt;Suffix2= 21 22 23 so on&lt;BR /&gt;I tried using two do loop for it. But after each iteration new value get replaced with old one without storing it. Please do help me if anyone knows how I can code it in sas studio.&lt;BR /&gt;</description>
      <pubDate>Mon, 24 May 2021 05:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743302#M232691</guid>
      <dc:creator>jhabikaskumar26</dc:creator>
      <dc:date>2021-05-24T05:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Storing a value of each iteration of do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743304#M232692</link>
      <description>&lt;P&gt;Please show your current attempt.&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 06:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743304#M232692</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-05-24T06:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Storing a value of each iteration of do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743308#M232694</link>
      <description>I have attached below a pdf which contains snapshot of code and log. In that we can observe that suffix12 resolves to 123 in last iteration but I want it should contains 121 122 123.&lt;BR /&gt;</description>
      <pubDate>Mon, 24 May 2021 07:37:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743308#M232694</guid>
      <dc:creator>jhabikaskumar26</dc:creator>
      <dc:date>2021-05-24T07:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Storing a value of each iteration of do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743310#M232696</link>
      <description>&lt;P&gt;Your pdf does not display in the preview.&lt;/P&gt;
&lt;P&gt;Please post code by copy/pasting the text into a window opened with the "little running man" button, and logs and other fixed-format text into a window opened with the &amp;lt;/&amp;gt; button.&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 07:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743310#M232696</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-05-24T07:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Storing a value of each iteration of do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743315#M232699</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro data;
%do i=1 %to 12;
%do j=1 %to 3;
%let suffix&amp;amp;i.=&amp;amp;i&amp;amp;j;
%put &amp;amp;&amp;amp;suffix&amp;amp;i;
%end;%end;
%mend data;

%data;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;SYMBOLGEN:  Macro variable I resolves to 12
SYMBOLGEN:  Macro variable J resolves to 1
MLOGIC(DATA):  %PUT &amp;amp;&amp;amp;suffix&amp;amp;i
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  Macro variable I resolves to 12
SYMBOLGEN:  Macro variable SUFFIX12 resolves to 121
121
MLOGIC(DATA):  %DO loop index variable J is now 2; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 12
MLOGIC(DATA):  %LET (variable name is SUFFIX12)
SYMBOLGEN:  Macro variable I resolves to 12
SYMBOLGEN:  Macro variable J resolves to 2
MLOGIC(DATA):  %PUT &amp;amp;&amp;amp;suffix&amp;amp;i
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  Macro variable I resolves to 12
SYMBOLGEN:  Macro variable SUFFIX12 resolves to 122
122
MLOGIC(DATA):  %DO loop index variable J is now 3; loop will iterate again.
SYMBOLGEN:  Macro variable I resolves to 12
MLOGIC(DATA):  %LET (variable name is SUFFIX12)
SYMBOLGEN:  Macro variable I resolves to 12
SYMBOLGEN:  Macro variable J resolves to 3
MLOGIC(DATA):  %PUT &amp;amp;&amp;amp;suffix&amp;amp;i
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  Macro variable I resolves to 12
SYMBOLGEN:  Macro variable SUFFIX12 resolves to 123
123
MLOGIC(DATA):  %DO loop index variable J is now 4; loop will not iterate again.
MLOGIC(DATA):  %DO loop index variable I is now 13; loop will not iterate again.
MLOGIC(DATA):  Ending execution.
91&lt;/PRE&gt;&lt;PRE&gt;Here, I want macro variable suffix12= 121 122 123. Please do help me in modifying my existing code.&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 May 2021 08:46:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743315#M232699</guid>
      <dc:creator>jhabikaskumar26</dc:creator>
      <dc:date>2021-05-24T08:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Storing a value of each iteration of do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743326#M232703</link>
      <description>&lt;P&gt;See this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro data;
%do i=1 %to 12;
  %let suffix&amp;amp;i=;
  %do j=1 %to 3;
    %let suffix&amp;amp;i. = &amp;amp;&amp;amp;suffix&amp;amp;i. &amp;amp;i&amp;amp;j;
  %end;
  %put &amp;amp;&amp;amp;suffix&amp;amp;i;
%end;
%mend data;

%data&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 May 2021 10:06:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743326#M232703</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-05-24T10:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Storing a value of each iteration of do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743338#M232713</link>
      <description>&lt;P&gt;Thank you for the help! It works.&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 10:58:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-of-each-iteration-of-do-loop/m-p/743338#M232713</guid>
      <dc:creator>jhabikaskumar26</dc:creator>
      <dc:date>2021-05-24T10:58:27Z</dc:date>
    </item>
  </channel>
</rss>

