In general i would say instead of using a single we could accomplish the same in following steps: 1. Take dump of Table A using proc sql into SAS dataset. 2. Do the same for Table B Load the Table B onto a proc format and apply that to table A. This should optimize the code. Most often the slowness of a query would depends on the connection driver either ODBC/Oracle and so on. So the throught process should ideally be to use a method to take a dump and use the other to optimize results, so i would say use the SQL code to pull the data and not join and use SAS formatting to join the data. if it helps create use proc ds2 for parallel record processing.
... View more