<?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: Help with array not working (want to divide a series of variables by 12) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-array-not-working-want-to-divide-a-series-of-variables/m-p/333265#M272135</link>
    <description>&lt;P&gt;OK thanks, was not aware I had to define both bw and newbw&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Feb 2017 03:39:44 GMT</pubDate>
    <dc:creator>fieldsa83</dc:creator>
    <dc:date>2017-02-16T03:39:44Z</dc:date>
    <item>
      <title>Help with array not working (want to divide a series of variables by 12)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-array-not-working-want-to-divide-a-series-of-variables/m-p/333261#M272133</link>
      <description>&lt;P&gt;I have bw1-bw1000 and i want to make a new version of each that is divided by 12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Made a data step and put this array, but it is not working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;do i=1 to 1000;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;newbw[i]=bw[i]/12;&lt;/DIV&gt;&lt;DIV&gt;end; &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any ideas why?&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Feb 2017 03:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-array-not-working-want-to-divide-a-series-of-variables/m-p/333261#M272133</guid>
      <dc:creator>fieldsa83</dc:creator>
      <dc:date>2017-02-16T03:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with array not working (want to divide a series of variables by 12)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-array-not-working-want-to-divide-a-series-of-variables/m-p/333264#M272134</link>
      <description>&lt;P&gt;You didn't include the whole data step so it is hard to tell.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set have ;
  array newbw (1000) ;
  array bw (1000) ;
  do i=1 to 1000; 
    newbw[i]=bw[i]/12;
  end;  
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The code above assumes that you have 1,000 numeric variables named BW1 to BW1000 and you want to create 1000 new variables named NEWBW1 to NEWBW1000.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 03:38:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-array-not-working-want-to-divide-a-series-of-variables/m-p/333264#M272134</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-02-16T03:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help with array not working (want to divide a series of variables by 12)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-array-not-working-want-to-divide-a-series-of-variables/m-p/333265#M272135</link>
      <description>&lt;P&gt;OK thanks, was not aware I had to define both bw and newbw&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 03:39:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-array-not-working-want-to-divide-a-series-of-variables/m-p/333265#M272135</guid>
      <dc:creator>fieldsa83</dc:creator>
      <dc:date>2017-02-16T03:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help with array not working (want to divide a series of variables by 12)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-array-not-working-want-to-divide-a-series-of-variables/m-p/333419#M272136</link>
      <description>&lt;P&gt;You need to get into the habit of reading the log.&lt;/P&gt;
&lt;P&gt;Your code would have generated something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR: Undeclared array referenced: newbw.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR: Variable newbw has not been declared as an array.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Telling you exactly what the issue was.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 15:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-array-not-working-want-to-divide-a-series-of-variables/m-p/333419#M272136</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-02-16T15:23:23Z</dc:date>
    </item>
  </channel>
</rss>

