<?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: Basic array naming question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189336#M35738</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A couple of items to add for your consideration ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, SAS does ban the re-use of array names.&amp;nbsp; The ban is so strong that even this program would fail:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data fails;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; array vars {3} v1 v2 v3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; array vars {3} v1 v2 v3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, have you considered using special missing values?&amp;nbsp; Instead of these statements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if var1=99 then var1=.;&lt;/P&gt;&lt;P&gt;if var5=999 then var5=.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider these instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if var1=99 then var1=.B;&lt;/P&gt;&lt;P&gt;if var5=999 then var5=.C;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That way, the variables can remain missing for analysis purposes, yet you can distinguish what the value was originally.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jan 2014 14:33:42 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2014-01-07T14:33:42Z</dc:date>
    <item>
      <title>Basic array naming question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189330#M35732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to use an array name multiple times? For example I am using an array to set certain variable values to missing if they satisfy a certain condition. Instead of using a new array for each condition I want to reinitialize the array and reuse it. See example below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current way to doing things (using &lt;SPAN class="st"&gt;implicitly-indexed arrays)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;data blah;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input var1 var2 var3 var4 var5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array &lt;STRONG&gt;miss1&lt;/STRONG&gt; var1 var2 var3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do over miss1; if miss1=&lt;STRONG&gt;99&lt;/STRONG&gt; then miss1=.; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array &lt;STRONG&gt;miss2&lt;/STRONG&gt; var4 var5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do over miss2; if miss2=&lt;STRONG&gt;999&lt;/STRONG&gt; then miss2=.; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to reuse the &lt;STRONG&gt;miss&lt;/STRONG&gt; array so I can run the code like:&lt;/P&gt;&lt;P&gt;data blah;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input var1 var2 var3 var4 var5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array &lt;STRONG&gt;miss&lt;/STRONG&gt; var1 var2 var3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do over miss; if miss=&lt;STRONG&gt;99&lt;/STRONG&gt; then miss=.; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array &lt;STRONG&gt;miss&lt;/STRONG&gt; var4 var5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do over miss; if miss=&lt;STRONG&gt;999&lt;/STRONG&gt; then miss=.; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 22:13:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189330#M35732</guid>
      <dc:creator>spirto</dc:creator>
      <dc:date>2014-01-06T22:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Basic array naming question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189331#M35733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are syntax errors in both versions of your code. You could use this instead (untested):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;array missVal{5} _temporary_ (3*99 2*999);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input var1 var2 var3 var4 var5;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;array miss{*} var1-var5;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do _n_ = 1 to dim(missVal);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if miss{_n_}=missVal{_n_} then call missing(miss{_n_}); &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 22:29:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189331#M35733</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-01-06T22:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Basic array naming question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189332#M35734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In answer to your question "can an array be reused" the answer is no.&lt;/P&gt;&lt;P&gt;but why would you wish to do this?&lt;/P&gt;&lt;P&gt;Your explanation of the purpose might lead to a solution -&amp;nbsp; if @PGStats has not already solved it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 22:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189332#M35734</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2014-01-06T22:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Basic array naming question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189333#M35735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter -&lt;/P&gt;&lt;P&gt;the reason I posed the question was so I wouldn't have to keep defining new arrays for each new condition. The array code remains virtually the same for each new condition aside from changing the array name in blue and the variable/condition in red below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array &lt;SPAN style="color: #0000ff;"&gt;miss&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;var1 var2 var3&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;do over &lt;SPAN style="color: #0000ff;"&gt;miss&lt;/SPAN&gt;; if &lt;SPAN style="color: #0000ff;"&gt;miss&lt;/SPAN&gt;&lt;STRONG&gt;=&lt;SPAN style="color: #ff0000;"&gt;99&lt;/SPAN&gt;&lt;/STRONG&gt; then &lt;SPAN style="color: #0000ff;"&gt;miss&lt;/SPAN&gt;=.; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I was just wondering if there was a way to reuse the "miss" array name each time so i wouldn't have to define a new array each time. My only use for the miss array is to assign missing values - after it has done its job for the variable/condition combination it is no longer required.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 22:47:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189333#M35735</guid>
      <dc:creator>spirto</dc:creator>
      <dc:date>2014-01-06T22:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Basic array naming question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189334#M35736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are probably going to be better off just getting the 999's and 99's out of the data from the beginning rather than having to try to deal with it later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like you are reading from a text file so enter period (.) instead of 999 for missing. Or use one of the special missing values.&lt;/P&gt;&lt;P&gt;If the data files have already been entered or are created using a data entry system that prevents using periods or letters then use an INFORMAT that will do the conversion for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc format ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; invalue miss999x '999'=. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; invalue miss99x '99'=. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; invalue miss9x '9'=. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input var1-var5 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; informat var1 var3 miss999x. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; informat var2 var5 miss99x. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; informat var4 miss9x. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'courier new', courier;"&gt;&amp;nbsp; put (_all_) (=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;1 2 3 4 5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;9 9 9 9 9&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;99 99 99 99 99&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;999 999 999 999 999&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;var1=1 var2=2 var3=3 var4=4 var5=5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;var1=9 var2=9 var3=9 var4=. var5=9&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;var1=99 var2=. var3=99 var4=99 var5=.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;var1=. var2=999 var3=. var4=999 var5=999&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 00:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189334#M35736</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-01-07T00:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Basic array naming question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189335#M35737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;intriguing approach. I will actually be reading in from another SAS dataset. Can your approach also be applied to data reading from another sas dataset or is it only applicable when reading from text files?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 14:16:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189335#M35737</guid>
      <dc:creator>spirto</dc:creator>
      <dc:date>2014-01-07T14:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Basic array naming question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189336#M35738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A couple of items to add for your consideration ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, SAS does ban the re-use of array names.&amp;nbsp; The ban is so strong that even this program would fail:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data fails;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; array vars {3} v1 v2 v3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; array vars {3} v1 v2 v3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, have you considered using special missing values?&amp;nbsp; Instead of these statements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if var1=99 then var1=.;&lt;/P&gt;&lt;P&gt;if var5=999 then var5=.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider these instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if var1=99 then var1=.B;&lt;/P&gt;&lt;P&gt;if var5=999 then var5=.C;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That way, the variables can remain missing for analysis purposes, yet you can distinguish what the value was originally.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 14:33:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189336#M35738</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-01-07T14:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Basic array naming question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189337#M35739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not really.&amp;nbsp; Again you are better off fixing the underlying problem of having missing values represented in your data as valid numbers instead of using SAS's built in missing value.&amp;nbsp; So if your existing dataset is called FRED then create a new permanent dataset called FRED_MISSING with the values recoded to missing and just use that dataset as the basis for your analyses going forward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could take advantage of the fact that SAS can query the format or informat attached to members in an array to help.&amp;nbsp; But I am not sure that it actually saves you anything over just creating multiple arrays and do loops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc format ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; invalue miss999x '999'=. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; invalue miss99x '99'=. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; invalue miss9x '9'=. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input var1-var5 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;1 2 3 4 5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;9 9 9 9 9&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;99 99 99 99 99&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;999 999 999 999 999&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set have ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; informat var1 var3 miss999x. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; informat var2 var5 miss99x. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; informat var4 miss9x. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; array miss var1-var5 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; do over miss ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if miss = input(scan(substr(vinformat(miss),5),1,'X'),??10.) then miss=.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put (_all_) (=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 15:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189337#M35739</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-01-07T15:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Basic array naming question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189338#M35740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your thoughts!! I guess the short answer is no you cannot reuse the same array name in a datastep but I see now there are many ways to get around this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 15:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189338#M35740</guid>
      <dc:creator>spirto</dc:creator>
      <dc:date>2014-01-07T15:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Basic array naming question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189339#M35741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no need to worry about reusing an arrayname because with very little engineering you can generate a unique (defined at data step compilation) arrayname. I hope someone will correct me if I am wrong but I believe that an array definition consumes very little resources.&lt;/P&gt;&lt;P&gt;The automatic macrovariable &amp;amp;sysindex is incremented at each invocation of the macro which contains it. So syntax like&lt;/P&gt;&lt;P&gt;%macro aname( namePref= ar );&lt;/P&gt;&lt;P&gt;&amp;amp;namePref&amp;amp;sysindex&lt;/P&gt;&lt;P&gt;%mend&amp;nbsp; aname ;&lt;/P&gt;&lt;P&gt;will prepare a unique name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then for each variable list you need to manage this way, generate a new array name by invoking the macro like:&lt;/P&gt;&lt;P&gt;%let arraN = %aname ;&lt;/P&gt;&lt;P&gt;Array &amp;amp;arraN &amp;amp;variable_list ;&lt;/P&gt;&lt;P&gt;do over &amp;amp;arraN ; if &amp;amp;arraN =99 then &amp;amp;arraN =. ; end;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 23:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-array-naming-question/m-p/189339#M35741</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2014-01-07T23:27:11Z</dc:date>
    </item>
  </channel>
</rss>

