title: PROC SQL Update Efficiency for Large Datasets
body: <p>I have a SAS Master Dataset with 10 Million Rows and 1800 columns. I need to update 10 columns using a transaction dataset with 15 million records, only for records with matching key. 
  I tried running a proc sql update statement using the following code. </p>
  
  <pre><code>proc sql;
  UPDATE lib1.master1 a
  
  SET col1 = (SELECT col1 FROM lib1.changes_1 b WHERE a.key=b.key),
      col2 = (SELECT col2 FROM lib1.changes_1 b WHERE a.key=b.key),
      col3 = (SELECT col3 FROM lib1.changes_1 b WHERE a.key=b.key),
      col4 = (SELECT col4 FROM lib1.changes_1 b WHERE a.key=b.key),
      col5 = (SELECT col5 FROM lib1.changes_1 b WHERE a.key=b.key),
      col6 = (SELECT col6 FROM lib1.changes_1 b WHERE a.key=b.key),
      col7 = (SELECT col7 FROM lib1.changes_1 b WHERE a.key=b.key),
      col8 = (SELECT col8 FROM lib1.changes_1 b WHERE a.key=b.key),
      col9 = (SELECT col9 FROM lib1.changes_1 b WHERE a.key=b.key)
  
  WHERE EXISTS ( SELECT 1 FROM lib1.changes_1 b WHERE A.key = B.key);
  quit;
  </code></pre>
  
  <p>I tried for just col1 for testing purpose and its been running for more than 4 hours. </p>
  
  <p>I can think of data merge, by dropping the 10 columns and then a left join but that would change the column ordering. Reordering 1800 columns would again be a tedious task. </p>
  
  <p>Is there a faster/more efficient technique?</p>