title: How to optimize proc sql join in SAS?
body: <p>I have 2 datasets:  t.a with 390K rows and 1 variable and t.b with 60 million rows and 350 variables. 
  I need to join this datasets quickly, but my query is too slow. </p>
  
  <p>How I can optimize query?</p>
  
  <p>My query:</p>
  
  <pre><code>    proc sql;
      create table с as 
      select distinct a.REP_CLID, b.REP_DATE, &amp;Score_Column, b.REP_AGE as AGE 
      from a (IDXWHERE =Yes) ,
      &amp;b (IDXWHERE =Yes)  
      where a.rep_clid = b.rep_clid 
  </code></pre>