You need to tell us more about your tables. When people call a table large then some mean 100K rows and others 100M rows.
What are the volumes (number of rows) of t2 and t4?
How many distinct values for RN do you have in t4?
What is the datatype of RN and if character what's the variable length.
Where is the data stored (SAS table on disk or in some database like Oracle or both)?
A SAS data step hash lookup would likely perform better. Points 1-3 above are for making a decision if your table t4 could fit into memory, point 4 is for making a decision if processing needs to get pushed to a database side for processing (which a data step hash lookup wouldn't).
Also don't use select * but list the variables you need explicitly, like: select t2.name, t2.rn, t4.xxxx, ....
... View more