<?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 New variables in array with lower bound other than 1 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/New-variables-in-array-with-lower-bound-other-than-1/m-p/34093#M6698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a reason you can't name them that way?&lt;/P&gt;&lt;P&gt;array testb(27:55) testb27-testb55;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2012 16:30:35 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2012-03-16T16:30:35Z</dc:date>
    <item>
      <title>New variables in array with lower bound other than 1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/New-variables-in-array-with-lower-bound-other-than-1/m-p/34092#M6697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use an array to create a new variable while preserving the old variable. The variables end in a number that range from 27-55, so I want my array range to match that. When I define the range with the existing variables, I get what I expect:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array test (27:55) x27 . . . x55; *These arrays refer to the correct variables;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I try to create a new variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array testb(27:55);&lt;/P&gt;&lt;P&gt;do i=27 to 55;&lt;/P&gt;&lt;P&gt;if test(i) = 1 then testb(i) = 5;&lt;/P&gt;&lt;P&gt;if test(i) = 2 then testb(i) = 10;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following variables&lt;/P&gt;&lt;P&gt;testb1 . . . testb29&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to define testb27-testb55 as new variables in an array? Thanks in advance for the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 16:19:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/New-variables-in-array-with-lower-bound-other-than-1/m-p/34092#M6697</guid>
      <dc:creator>JohnB_</dc:creator>
      <dc:date>2012-03-16T16:19:19Z</dc:date>
    </item>
    <item>
      <title>New variables in array with lower bound other than 1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/New-variables-in-array-with-lower-bound-other-than-1/m-p/34093#M6698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a reason you can't name them that way?&lt;/P&gt;&lt;P&gt;array testb(27:55) testb27-testb55;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 16:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/New-variables-in-array-with-lower-bound-other-than-1/m-p/34093#M6698</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-03-16T16:30:35Z</dc:date>
    </item>
    <item>
      <title>New variables in array with lower bound other than 1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/New-variables-in-array-with-lower-bound-other-than-1/m-p/34094#M6699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is one way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want (rename=(testb1-testb29=testb27-testb55));&lt;/P&gt;&lt;P&gt;&amp;nbsp; array testb(27:55);&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=27 to 55;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i le 40 then testb(i) = 5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else testb(i) = 10;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 16:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/New-variables-in-array-with-lower-bound-other-than-1/m-p/34094#M6699</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-16T16:32:16Z</dc:date>
    </item>
  </channel>
</rss>

