How to optimize proc sql join in SAS? -


I have 2 datasets: TA with lines of 390 and 1 variable and T.B. With 60 million rows and 350 variables. I need to quickly get into this dataset, but my query is very slow

How can I optimize queries?

My query:

  proc sql; Select as a table a.REP_CLID, b.REP_DATE, and Score_Column, b.REP_AGE as AGE one (IDXWar = Yes), and amp; Select b (idxhair = yes) where a.rep_clid = b.rep_clid   

Since your large In the table, you already have an index on rep_clid, it seems like a good candidate is more important for a data phase key merge that you are simply keeping the variable of interest:

  Data c; Set; Set B key = rep_clid; / * Requires a unique index at rep_clid to work properly * / if _IORC_ again; _ERROR_ = 0; remove; End; Run;  

This will return Records with rep_clid present in both A and B. You can then display with the nodupkey option through the output sort.

If you have a non-unique index on B, it can still be done to work, but the syntax is a bit more complicated:

  C; Set; As long as (eof); Set B key = rep_clid end = eof; / * Rep_clid * / if _IORC_ will work with a non-unique index; _ERROR_ = 0; remove; End; Other output; End; Run;  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -