<?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: array question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18168#M2703</link>
    <description>Good idea, but it didn't help.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
448  array region{22} $ region_1 - region_22;&lt;BR /&gt;
449  array ais{22} ais_1 - ais_22;&lt;BR /&gt;
450  array trhead{22}  trhead1-trhead22;&lt;BR /&gt;
451  do i = 1 to 22 ;&lt;BR /&gt;
452  if region(i)='HEAD' then do trhead(i)=ais(i); end;&lt;BR /&gt;
                                       -&lt;BR /&gt;
                                       73&lt;BR /&gt;
ERROR: The variable type of trhead is invalid in this context.&lt;BR /&gt;
ERROR: Illegal reference to the array trhead.&lt;BR /&gt;
ERROR 73-322: Expecting an =.&lt;BR /&gt;
&lt;BR /&gt;
453  end;</description>
    <pubDate>Thu, 15 May 2008 19:55:46 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-05-15T19:55:46Z</dc:date>
    <item>
      <title>array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18166#M2701</link>
      <description>Any idea what is wrong with this code?&lt;BR /&gt;
&lt;BR /&gt;
array region{22} region_1 - region_22;&lt;BR /&gt;
array ais{22} ais_1 - ais_22;&lt;BR /&gt;
array trhead{22}  trhead1-trhead22;&lt;BR /&gt;
do i = 1 to dim(ais) ;&lt;BR /&gt;
       if region(i)='HEAD' then do trhead(i)=ais(i); end;&lt;BR /&gt;
                                       -&lt;BR /&gt;
                                       73&lt;BR /&gt;
ERROR: The variable type of trhead is invalid in this context.&lt;BR /&gt;
ERROR: Illegal reference to the array trhead.&lt;BR /&gt;
ERROR 73-322: Expecting an =.&lt;BR /&gt;
&lt;BR /&gt;
325  end;</description>
      <pubDate>Thu, 15 May 2008 19:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18166#M2701</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-15T19:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18167#M2702</link>
      <description>My first guess would be that the array region is defined as numeric.&lt;BR /&gt;
&lt;BR /&gt;
replace array region{22} region_1 - region_22;&lt;BR /&gt;
array region{22} $ region_1 - region_22;&lt;BR /&gt;
&lt;BR /&gt;
See what happens.&lt;BR /&gt;
&lt;BR /&gt;
-Darryl</description>
      <pubDate>Thu, 15 May 2008 19:35:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18167#M2702</guid>
      <dc:creator>darrylovia</dc:creator>
      <dc:date>2008-05-15T19:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18168#M2703</link>
      <description>Good idea, but it didn't help.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
448  array region{22} $ region_1 - region_22;&lt;BR /&gt;
449  array ais{22} ais_1 - ais_22;&lt;BR /&gt;
450  array trhead{22}  trhead1-trhead22;&lt;BR /&gt;
451  do i = 1 to 22 ;&lt;BR /&gt;
452  if region(i)='HEAD' then do trhead(i)=ais(i); end;&lt;BR /&gt;
                                       -&lt;BR /&gt;
                                       73&lt;BR /&gt;
ERROR: The variable type of trhead is invalid in this context.&lt;BR /&gt;
ERROR: Illegal reference to the array trhead.&lt;BR /&gt;
ERROR 73-322: Expecting an =.&lt;BR /&gt;
&lt;BR /&gt;
453  end;</description>
      <pubDate>Thu, 15 May 2008 19:55:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18168#M2703</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-15T19:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18169#M2704</link>
      <description>I think I meant trhead but try to define them all as character&lt;BR /&gt;
&lt;BR /&gt;
-Darryl</description>
      <pubDate>Thu, 15 May 2008 20:15:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18169#M2704</guid>
      <dc:creator>darrylovia</dc:creator>
      <dc:date>2008-05-15T20:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18170#M2705</link>
      <description>The second ones should be numeric, but it still isn't working. Thanks for your help.  I'm calling tech support. &lt;BR /&gt;
  &lt;BR /&gt;
513  array region{22} $ region_1 - region_22;&lt;BR /&gt;
514  array ais{22} $ ais_1 - ais_22;&lt;BR /&gt;
515  array trhead{22} $ trhead1-trhead22;&lt;BR /&gt;
516  do i = 1 to 22 ;&lt;BR /&gt;
517  if region(i)='HEAD' then do trhead(i)=ais(i); end;&lt;BR /&gt;
                                       -&lt;BR /&gt;
                                       73&lt;BR /&gt;
ERROR: The variable type of trhead is invalid in this context.&lt;BR /&gt;
ERROR: Illegal reference to the array trhead.&lt;BR /&gt;
ERROR 73-322: Expecting an =.&lt;BR /&gt;
&lt;BR /&gt;
518  end;</description>
      <pubDate>Thu, 15 May 2008 20:59:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18170#M2705</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-15T20:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18171#M2706</link>
      <description>You need a semi-colon after the do&lt;BR /&gt;
&lt;BR /&gt;
replace if region(i)='HEAD' then do trhead(i)=ais(i); end;&lt;BR /&gt;
with &lt;BR /&gt;
if region(i)='HEAD' then do; trhead(i)=ais(i); end;&lt;BR /&gt;
&lt;BR /&gt;
-Darryl</description>
      <pubDate>Thu, 15 May 2008 21:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-question/m-p/18171#M2706</guid>
      <dc:creator>darrylovia</dc:creator>
      <dc:date>2008-05-15T21:30:56Z</dc:date>
    </item>
  </channel>
</rss>

