<?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: Using substr function in arrays in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Using-substr-function-in-arrays/m-p/5233#M453</link>
    <description>Ripper!  It worked a treat.  Many thanks Advoss.</description>
    <pubDate>Tue, 30 Oct 2007 03:09:42 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2007-10-30T03:09:42Z</dc:date>
    <item>
      <title>Using substr function in arrays</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Using-substr-function-in-arrays/m-p/5231#M451</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
I am new to SAS, so please bear with me.  I am trying to use an array to split a 240 character field of death codes into 48 new variables, each with a width of 5 characters .... with a starting position that moves from 1, 6, 11, 16, 21 etc.  Alas, my syntax below keeps succumbing to the error message "The array subscript is out of range":&lt;BR /&gt;
&lt;BR /&gt;
data b;&lt;BR /&gt;
	set a;&lt;BR /&gt;
	array split(48) $ entity1 - entity48;&lt;BR /&gt;
		do i = 1-48;&lt;BR /&gt;
		j = ((i-1)*5)+1;&lt;BR /&gt;
		split(i) = substr(entity_axis_data,j,5);&lt;BR /&gt;
	end;&lt;BR /&gt;
run; &lt;BR /&gt;
&lt;BR /&gt;
Any pearls of wisdom would be appreciated immensely.&lt;BR /&gt;
&lt;BR /&gt;
Janine</description>
      <pubDate>Fri, 26 Oct 2007 09:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Using-substr-function-in-arrays/m-p/5231#M451</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-10-26T09:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using substr function in arrays</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Using-substr-function-in-arrays/m-p/5232#M452</link>
      <description>Try this:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
data b;&lt;BR /&gt;
  set a;&lt;BR /&gt;
  length entity1 - entity48 $5;&lt;BR /&gt;
  array split(48) entity1 - entity48;&lt;BR /&gt;
  do i = 1 to 48;&lt;BR /&gt;
    j = ((i-1)*5)+1;&lt;BR /&gt;
   split(i) = substr(entity_axis_data,j,5);&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Oct 2007 13:45:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Using-substr-function-in-arrays/m-p/5232#M452</guid>
      <dc:creator>advoss</dc:creator>
      <dc:date>2007-10-26T13:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using substr function in arrays</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Using-substr-function-in-arrays/m-p/5233#M453</link>
      <description>Ripper!  It worked a treat.  Many thanks Advoss.</description>
      <pubDate>Tue, 30 Oct 2007 03:09:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Using-substr-function-in-arrays/m-p/5233#M453</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-10-30T03:09:42Z</dc:date>
    </item>
  </channel>
</rss>

