title: SAS Array subscript out of range
body: <p>I am getting the Array subscript out of range error: </p>
  
  <pre><code>ERROR: Array subscript out of range at line 408 column 169.
  SYM_ROOT=FSV DATE=. TIME_M=. BID=. BIDSIZ=. ASK=. ASKSIZ=. EXN=.
  FIRST.SYM_ROOT=1 LAST.SYM_ROOT=1 FIRST.DATE=1 LAST.DATE=1 FIRST.TIME_M=1
  LAST.TIME_M=1 nexb1=. nexb2=. nexb3=. nexb4=. nexb5=. nexb6=. nexb7=. nexb8=.
  nexb9=. nexb10=. nexb11=. nexb12=. nexb13=. nexb14=. nexb15=. nexb16=. nexb17=.
  nexo1=. nexo2=. nexo3=. nexo4=. nexo5=. nexo6=. nexo7=. nexo8=. nexo9=. nexo10=.
  nexo11=. nexo12=. nexo13=. nexo14=. nexo15=. nexo16=. nexo17=. sexb1=. sexb2=.
  sexb3=. sexb4=. sexb5=. sexb6=. sexb7=. sexb8=. sexb9=. sexb10=. sexb11=.
  sexb12=. sexb13=. sexb14=. sexb15=. sexb16=. sexb17=. sexo1=. sexo2=. sexo3=.
  sexo4=. sexo5=. sexo6=. sexo7=. sexo8=. sexo9=. sexo10=. sexo11=. sexo12=.
  sexo13=. sexo14=. sexo15=. sexo16=. sexo17=. _I_=. i=18 BB=. BO=. MIDPRICE=.
  BBSize=. BOSize=. NUMEX=. _ERROR_=1 _N_=6417740
  </code></pre>
  
  <p>However, I am not sure what happened, because the code has previously worked on a different dataset. </p>
  
  <p>The only thing that I can think of is that, because the dataset I am having problem with is the subset of the original one (which worked), it might not have the complete range of exn (I am using a variable named exn as the index of the array). </p>
  
  <p>I defined the array as: </p>
  
  <pre><code>array nexb nexb:; array nexo nexo:; array sexb sexb:; array sexo sexo:;
  </code></pre>
  
  <p>The variable I am talking about is called exn, and it is used to reference the array: </p>
  
  <pre><code>nexb(exn)=bid;nexo(exn)=ofr;sexb(exn)=bidsiz;sexo(exn)=ofrsiz;
  </code></pre>
  
  <p>The arrays are initialized in the following way: </p>
  
  <pre><code>do i=1 to 17;
    nexb(i)=.; nexo(i)=.; sexb(i)=.; sexo(i)=.;
  end;
  </code></pre>
  
  <p>Originally exn spans from 1 to 17. Now I think some of the numbers in between might be missing in the dataset. But why is that a problem? They are initialized anyways. </p>