anandbilliva
to see what is going on under the syntax layer, use the system option SASTRACE, like:
options sastrace=',,,d' sastraceloc=FILE "~somewhere/problem1.log" nostsuffix;
Additionally, in the proc sql statement, add option _TREE.
When you get a lot of details in the SASlog from _TREE, probably your query will be inefficient. You want a report from _TREE showing that the bulk of the query has been passed to the database server.
good luck
PeterC