title: Using a sas lookup table when the column number changes
body: <p>I have two sas datasets, </p>
  
  <pre><code>Table 1                        Table 2
  col1 col2 col3 col4 col5       a  b
  .    1    2    3    4          1  1          
  1    5    8    6    1          1  4
  2    5    9    7    1          4  3
  3    6    9    7    1          2  1
  4    6    9    7    2          2  2
  </code></pre>
  
  <p>where table 1 is a lookup table for values a and b in table 2, such that I can make a column c.  In table 1 a is equivalent to col1 and b to row1 (i.e. the new column c in table 2 should read 5,1,7,5,9.  How can I achieve this in sas.  I was thinking of reading table 1 into a 2d array then get column c = array(a,b), but can't get it to work</p>