<?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: Error: Array subscript out of range at row 67 column 176. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877251#M346564</link>
    <description>&lt;P&gt;My first thought is that one of those 4GL variables:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;starting_node,start_index,ending_node,end_index&lt;/LI-CODE&gt;
&lt;P&gt;has value outside of array dimensions.&lt;/P&gt;
&lt;P&gt;Their values are:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#000000"&gt;starting_node=1&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;FONT color="#000000"&gt;start_index=7&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;FONT color="#000000"&gt;ending_node=2&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;FONT color="#000000"&gt;end_index=1&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;one of them must be greater than:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;&amp;amp;n_nodes
&amp;amp;n_grps
&amp;amp;n_nodes
&amp;amp;n_grps&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add `%put` before data step to see what values those 4 macrovariables have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Wed, 24 May 2023 11:50:38 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2023-05-24T11:50:38Z</dc:date>
    <item>
      <title>Error: Array subscript out of range at row 67 column 176.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877225#M346545</link>
      <description>&lt;P&gt;Dear all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I get this error message on running this code. Please&amp;nbsp; can any one help?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sankey_paths3;
        set sankey_paths2;
        by starting_node ending_node start end;
        
        /**Hold running totals for group counts**/
        array start_n {&amp;amp;n_nodes,&amp;amp;n_grps} (%sysevalf(&amp;amp;n_nodes*&amp;amp;n_grps)*0) ;
        array end_n {&amp;amp;n_nodes,&amp;amp;n_grps} (%sysevalf(&amp;amp;n_nodes*&amp;amp;n_grps)*0) ;
                
        /***Build the Bezier Curve Connectors: Use Cubic Bezier Equation: 
            B(t)=(1-t)^3*P0 + 3(1-t)^2*t*P1 + 3(1-t)*t^2*P2 + t^3*P3, 0 &amp;lt;= t &amp;lt;= 1***/
        length path_index $20.;
        path_index=catx('-',starting_node,start_index,end_index);
        /*Find y-axis values for start/end corners of Bezier curves*/
        start_y1=start_group_min+start_group_diff*(start_n(starting_node,start_index)/start_group_n);
        start_y2=start_y1+start_group_diff*(n_move/start_group_n);
        end_y1=end_group_min+end_group_diff*(end_n(ending_node,end_index)/end_group_n)+end_group_diff*(n_move/end_group_n);
        end_y2=end_y1-end_group_diff*(n_move/end_group_n);
        /**Bezier Curve 1: From Left group to Right Group path**/
        do t = 0 to 1 by 1/25;
            x=((1-t)**3)*start_group_x+
                3*((1-t)**2)*t*(start_group_x+(end_group_x-start_group_x)/3)+
                3*(1-t)*(t**2)*(start_group_x+2*(end_group_x-start_group_x)/3)+
                (t**3)*end_group_x;
            y=((1-t)**3)*start_y2+3*((1-t)**2)*t*start_y2+3*(1-t)*(t**2)*end_y1+(t**3)*end_y1;
            output;
        end;
        /**Bezier Curve 2: From Right Group back to Left Group**/
        do t = 0 to 1 by 1/25;
            x=((1-t)**3)*end_group_x+
                3*((1-t)**2)*t*(start_group_x+2*(end_group_x-start_group_x)/3)+
                3*(1-t)*(t**2)*(start_group_x+(end_group_x-start_group_x)/3)+
                (t**3)*start_group_x;
            y=((1-t)**3)*end_y2+3*((1-t)**2)*t*end_y2+3*(1-t)*(t**2)*start_y1+(t**3)*start_y1;
            output;
        end;
        /**Increase running total for each groups N**/
        start_n(starting_node,start_index)+n_move;
        end_n(ending_node,end_index)+n_move;
        
        keep x y path_index start n_move;
    run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is the message in log (I have attached a test dataset):&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#800000"&gt;ERROR: Array subscript out of range at row 67 column 176.&lt;/FONT&gt;
&lt;FONT color="#000000"&gt;starting_node=1 start=16 start_group_n=1
start_group_min=90.714285714 start_group_max=95.714285714
start_group_diff=5 start_group_x=5 start_index=7 ending_node=2
end=2 end_group_n=14 end_group_min=0 end_group_max=70
end_group_diff=70 end_group_x=33.333333333 end_index=1 n_move=1
FIRST.starting_node=0 LAST.starting_node=1 FIRST.ending_node=0
LAST.ending_node=1 FIRST.start=1 LAST.start=1 FIRST.end=1
LAST.end=1 start_n1=0 start_n2=0 start_n3=0 start_n4=0
start_n5=0 start_n6=0 start_n7=0 start_n8=0 start_n9=0
start_n10=0 start_n11=0 start_n12=0 start_n13=0 start_n14=0
start_n15=0 start_n16=0 start_n17=0 start_n18=0 start_n19=0
start_n20=0 start_n21=0 start_n22=0 start_n23=0 start_n24=0
end_n1=0 end_n2=0 end_n3=0 end_n4=0 end_n5=0 end_n6=0 end_n7=0
end_n8=0 end_n9=0 end_n10=0 end_n11=0 end_n12=0 end_n13=0
end_n14=0 end_n15=0 end_n16=0 end_n17=0 end_n18=0 end_n19=0
end_n20=0 end_n21=0 end_n22=0 end_n23=0 end_n24=0
path_index=1-7-1 start_y1=. _ERROR_=1 _N_=7&lt;/FONT&gt;
&lt;FONT color="#0000FF"&gt;NOTE: The SAS System stopped processing this step because of
      errors.
NOTE: There were 8 observations read from the data set
      WORK.SANKEY_PATHS2.
WARNING: The data set WORK.SANKEY_PATHS3 may be incomplete.
         When this step was stopped there were 6 observations
         and 67 variables.


&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 09:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877225#M346545</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2023-05-24T09:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Array subscript out of range at Zeile 67 Spalte 176.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877227#M346547</link>
      <description>&lt;P&gt;The error message gives you a nice clue. At least one of your arrays fail to include the values of&amp;nbsp;starting_node, start_index, ending_node and end_index.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you create the &amp;amp;n_nodes and &amp;amp;n_groups macro variables, make sure that they are 'large enough' to hold the values of the four variables above.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 09:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877227#M346547</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2023-05-24T09:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Array subscript out of range at row 67 column 176.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877230#M346548</link>
      <description>&lt;P&gt;I don't understand why this is not&amp;nbsp; large enough. Please can you explain?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anita_n_0-1684920596101.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84240i0D348D3DD2A1CC5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anita_n_0-1684920596101.png" alt="Anita_n_0-1684920596101.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;These are the number of groups I have in each node. Its being working for other datasets, I don't know why it's not working here&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 09:36:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877230#M346548</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2023-05-24T09:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Array subscript out of range at row 67 column 176.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877232#M346550</link>
      <description>&lt;P&gt;I don't know what this data is?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, to help you the best: Take a look at the 7th observation of your input data. This is where the error happens when the data step reads the data (_N_ = 7).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the four variable values here do not fit within the index values of the arrays.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 09:39:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877232#M346550</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2023-05-24T09:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Array subscript out of range at row 67 column 176.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877242#M346558</link>
      <description>&lt;P&gt;unfortunately I cannot fishout the problem&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 11:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877242#M346558</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2023-05-24T11:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Array subscript out of range at row 67 column 176.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877251#M346564</link>
      <description>&lt;P&gt;My first thought is that one of those 4GL variables:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;starting_node,start_index,ending_node,end_index&lt;/LI-CODE&gt;
&lt;P&gt;has value outside of array dimensions.&lt;/P&gt;
&lt;P&gt;Their values are:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#000000"&gt;starting_node=1&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;FONT color="#000000"&gt;start_index=7&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;FONT color="#000000"&gt;ending_node=2&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;FONT color="#000000"&gt;end_index=1&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;one of them must be greater than:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;&amp;amp;n_nodes
&amp;amp;n_grps
&amp;amp;n_nodes
&amp;amp;n_grps&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add `%put` before data step to see what values those 4 macrovariables have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 11:50:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877251#M346564</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-24T11:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Array subscript out of range at row 67 column 176.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877274#M346573</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;thankyou, I don't know why or what happend but I created the input data again and run&lt;/P&gt;
&lt;P&gt;the code again and it's now working&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 13:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Array-subscript-out-of-range-at-row-67-column-176/m-p/877274#M346573</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2023-05-24T13:56:32Z</dc:date>
    </item>
  </channel>
</rss>

