<?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: Loop within a macro in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/497966#M32035</link>
    <description>&lt;P&gt;Arrays are addressing mechanisms for variables, you can't have "variable-less" arrays. But you can define "temporary arrays". Google "sas temporary arrays" for further information.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Sep 2018 19:34:51 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-09-21T19:34:51Z</dc:date>
    <item>
      <title>Loop within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/497961#M32034</link>
      <description>&lt;P&gt;Is it possible to create an array with string values (not variables) to rename values?&lt;/P&gt;&lt;P&gt;I know a macro does this, but it's already inside a parent macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that this query does not work, but it would be something like this:&lt;/P&gt;&lt;P&gt;DATA ONE;&lt;BR /&gt;SET TWO;&lt;/P&gt;&lt;P&gt;ARRAY REWRITE{2, 5} "LilyOrchid" "LilyRose" "LilyRoseOrchid" "LilyRoseJasmine" "LilyRoseOrchidJasmine" "2FOrchid" "2FRose" "3FOrchid" "3FJasmine" "4F";&lt;/P&gt;&lt;P&gt;DO i= 1 to 5;&lt;BR /&gt;IF FLOWER_ARRANGEMENT=REWRITE{1, i} THEN FLOWER_ARRANGEMENT=REWRITE{2, i};&lt;BR /&gt;END;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 19:08:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/497961#M32034</guid>
      <dc:creator>a_ramos</dc:creator>
      <dc:date>2018-09-21T19:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Loop within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/497966#M32035</link>
      <description>&lt;P&gt;Arrays are addressing mechanisms for variables, you can't have "variable-less" arrays. But you can define "temporary arrays". Google "sas temporary arrays" for further information.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 19:34:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/497966#M32035</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-09-21T19:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Loop within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/497968#M32036</link>
      <description>&lt;P&gt;Try adding this word:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;_temporary_&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;inside the array statement, just after the closing brackets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ARRAY REWRITE{2, 5} _temporary_ "LilyOrchid" ............................;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 19:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/497968#M32036</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-09-21T19:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Loop within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/497970#M32037</link>
      <description>&lt;P&gt;Formatting might work for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value $Gender
		'M'='Male'
		'F'='Female'
		other='UNK';
run;

data test;
set sashelp.class;
format sex $Gender.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Sep 2018 19:48:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/497970#M32037</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-09-21T19:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Loop within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/498010#M32039</link>
      <description>Agreed with &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83078"&gt;@SuryaKiran&lt;/a&gt;, this is a better use for PROC FORMAT than a temporary array though it's a perfectly valid option. A better method may be to use FINDW to find the word in a fixed list and then once you have the index, look it up in the temporary array. One less loop.</description>
      <pubDate>Sat, 22 Sep 2018 00:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/498010#M32039</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-22T00:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Loop within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/498522#M32049</link>
      <description>&lt;P&gt;Thank you. It was good to discover that this is possible.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2018 18:38:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/498522#M32049</guid>
      <dc:creator>a_ramos</dc:creator>
      <dc:date>2018-09-24T18:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Loop within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/498523#M32050</link>
      <description>&lt;P&gt;Thank you. I'll choose the array because I'd rather not interrupt the dataset in what I'm doing&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2018 18:45:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Loop-within-a-macro/m-p/498523#M32050</guid>
      <dc:creator>a_ramos</dc:creator>
      <dc:date>2018-09-24T18:45:20Z</dc:date>
    </item>
  </channel>
</rss>

