<?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 Array Subset Out Of Range - n00b in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Array-Subset-Out-Of-Range-n00b/m-p/318147#M61837</link>
    <description>&lt;P&gt;&amp;nbsp;First time posting on the discussion boards here (I believe).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I continue to encounter the error: "&lt;SPAN&gt;ERROR: Array subscript out of range at line 61 column 31."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The code is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data conversion;
set work.combo2;
array original_variables{7} rawsug refsug HFCS glucose dextrose total totalsweet;
array conversion_variables{7} rawsug_tbsp refsug_tbsp HFCS_tbsp glucose_tbsp dextrose_tbsp total_tbsp totalsweet_tbsp;
do vars= 1-7;
	conversion_variables{vars} = original_variables{vars}/3; /* This is line 61*/
end;
drop vars;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;DIV class="sasError"&gt;And the exact error message:&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&lt;PRE&gt;ERROR: Array subscript out of range at line 61 column 31.
 Year=1970 Grains=6.93 Dairy=1.81 Meat_Fish=3.25 Vegetables=3.29 Fruits=1.12 Uspop=205.052 RawSug=37.112167365 RefSug=34.684268565
 HFCS=0.1867832418 Glucose=4.7409189704 Dextrose=1.5663774862 Total=6.4940796983 Syrup=0.1695530355 Honey=0.3424306404
 TotalSweet=41.690331939 rawsug_tbsp=. refsug_tbsp=. HFCS_tbsp=. glucose_tbsp=. dextrose_tbsp=. total_tbsp=. totalsweet_tbsp=.
 vars=-6 _ERROR_=1 _N_=1&lt;/PRE&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;I'm using an example from Section 13.5 "Learning SAS By Example" as my template and it seems like this should work. is there something I am missing?&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Thanks for taking the time to review.&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Sun, 11 Dec 2016 17:52:05 GMT</pubDate>
    <dc:creator>jdgriffin</dc:creator>
    <dc:date>2016-12-11T17:52:05Z</dc:date>
    <item>
      <title>Array Subset Out Of Range - n00b</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Subset-Out-Of-Range-n00b/m-p/318147#M61837</link>
      <description>&lt;P&gt;&amp;nbsp;First time posting on the discussion boards here (I believe).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I continue to encounter the error: "&lt;SPAN&gt;ERROR: Array subscript out of range at line 61 column 31."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The code is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data conversion;
set work.combo2;
array original_variables{7} rawsug refsug HFCS glucose dextrose total totalsweet;
array conversion_variables{7} rawsug_tbsp refsug_tbsp HFCS_tbsp glucose_tbsp dextrose_tbsp total_tbsp totalsweet_tbsp;
do vars= 1-7;
	conversion_variables{vars} = original_variables{vars}/3; /* This is line 61*/
end;
drop vars;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;DIV class="sasError"&gt;And the exact error message:&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&lt;PRE&gt;ERROR: Array subscript out of range at line 61 column 31.
 Year=1970 Grains=6.93 Dairy=1.81 Meat_Fish=3.25 Vegetables=3.29 Fruits=1.12 Uspop=205.052 RawSug=37.112167365 RefSug=34.684268565
 HFCS=0.1867832418 Glucose=4.7409189704 Dextrose=1.5663774862 Total=6.4940796983 Syrup=0.1695530355 Honey=0.3424306404
 TotalSweet=41.690331939 rawsug_tbsp=. refsug_tbsp=. HFCS_tbsp=. glucose_tbsp=. dextrose_tbsp=. total_tbsp=. totalsweet_tbsp=.
 vars=-6 _ERROR_=1 _N_=1&lt;/PRE&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;I'm using an example from Section 13.5 "Learning SAS By Example" as my template and it seems like this should work. is there something I am missing?&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Thanks for taking the time to review.&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sun, 11 Dec 2016 17:52:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Subset-Out-Of-Range-n00b/m-p/318147#M61837</guid>
      <dc:creator>jdgriffin</dc:creator>
      <dc:date>2016-12-11T17:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Array Subset Out Of Range - n00b</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Subset-Out-Of-Range-n00b/m-p/318148#M61838</link>
      <description>&lt;P&gt;Looking at the error you can see VARS=-6&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your do statement is incorrect and resolves to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do vars=1-7 -&amp;gt; do vars=-6&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do vars=1 to 7;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Dec 2016 17:54:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Subset-Out-Of-Range-n00b/m-p/318148#M61838</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-11T17:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Array Subset Out Of Range - n00b</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Subset-Out-Of-Range-n00b/m-p/318150#M61839</link>
      <description>&lt;P&gt;Thank you for the quick reply. It is much appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: That fix worked perfectly!&lt;/P&gt;</description>
      <pubDate>Sun, 11 Dec 2016 17:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Subset-Out-Of-Range-n00b/m-p/318150#M61839</guid>
      <dc:creator>jdgriffin</dc:creator>
      <dc:date>2016-12-11T17:56:03Z</dc:date>
    </item>
  </channel>
</rss>

