title: sas load array from table
body: <p>I need to load a 2d array from table to a SAS data step and then use it to perform variable transformation in another table. The array looks something like this:</p>
  
  <ul>
  <li>rows: initial_value 1-4  </li>
  <li>columns: year 1-4</li>
  </ul>
  
  <p><code>
  1 1 2 3 
  2 2 2 3 
  3 4 4 4 
  4 4 5 6
  </code></p>
  
  <p>So far I've hardcoded the array into sas code: 
  <code>
  data example;
      array lookup {4,4} _temporary_
      1 1 2 3 
      2 2 2 3 
      3 4 4 4 
      4 4 5 6
      ;
      set source(keep=(value years));
      value_final = lookup{value, years};
  run;
  </code></p>
  
  <p>How do I do the same thing without hardcoding the matrix, but rather loading a table into data step and using as array?</p>