No sure what you want to achieve, so my reply will be incomplete, but here are a few starting points:
- are the datasets indexed by variable ROW?
- calling proc sql over and over is slower than calling it once and then doing all the SELECTs or UPDATEs
- yes, sasfile might help, you should test it.
To step back a bit though, it is
much slower to update tables one value at a time than to update in bulk by joining, so try and see if you can modify the logic to work in bulk.