<?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: Illegal reference to an array in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Illegal-reference-to-an-array/m-p/775978#M246689</link>
    <description>&lt;P&gt;You need the (index-variable) on the LHS of the = as you have on the right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; categorical[j]=vvalue(categorical[j]);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Oct 2021 21:46:55 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2021-10-22T21:46:55Z</dc:date>
    <item>
      <title>Illegal reference to an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Illegal-reference-to-an-array/m-p/775975#M246688</link>
      <description>&lt;P&gt;Hi all, I am struggling with my do loop. I continue to get "illegal reference to an array for the "categorical and npredictors" array, but it works just fine for my first array "var_list." Is there something that I am missing? I am using SAS 9.4. I also tried to run the arrays in separate data steps and it gave me the same error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="schatr2_1-1634938347232.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64973i6EF99A02EE73F464/image-size/medium?v=v2&amp;amp;px=400" role="button" title="schatr2_1-1634938347232.png" alt="schatr2_1-1634938347232.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="schatr2_2-1634938421948.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64974i3FA182C2AA6C9F8F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="schatr2_2-1634938421948.png" alt="schatr2_2-1634938421948.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 21:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Illegal-reference-to-an-array/m-p/775975#M246688</guid>
      <dc:creator>393310</dc:creator>
      <dc:date>2021-10-22T21:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Illegal reference to an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Illegal-reference-to-an-array/m-p/775978#M246689</link>
      <description>&lt;P&gt;You need the (index-variable) on the LHS of the = as you have on the right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; categorical[j]=vvalue(categorical[j]);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 21:46:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Illegal-reference-to-an-array/m-p/775978#M246689</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2021-10-22T21:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Illegal reference to an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Illegal-reference-to-an-array/m-p/775979#M246690</link>
      <description>&lt;P&gt;You cannot have a non-array variable with the same name as the array.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 21:51:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Illegal-reference-to-an-array/m-p/775979#M246690</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-10-22T21:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Illegal reference to an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Illegal-reference-to-an-array/m-p/775980#M246691</link>
      <description>&lt;P&gt;Variables can't have the same name as arrays.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I usually use _ in front of my arrays, as a coding standard it helps for sure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array _categorical(*) ... ;
do .... ;
categorical = _categorical(i);
....&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Oct 2021 21:55:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Illegal-reference-to-an-array/m-p/775980#M246691</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-22T21:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Illegal reference to an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Illegal-reference-to-an-array/m-p/776055#M246736</link>
      <description>Thank you so much!</description>
      <pubDate>Sat, 23 Oct 2021 20:41:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Illegal-reference-to-an-array/m-p/776055#M246736</guid>
      <dc:creator>393310</dc:creator>
      <dc:date>2021-10-23T20:41:24Z</dc:date>
    </item>
  </channel>
</rss>

