Good Morning All,
I have the following code:
proc sql;
create table fourth_run as
select b.*
from mdj.zip5_august a left join
mdj.addr_100m_zip9_zip5 b on
a.zip5 = substr(b.prop_zip_code,1,5);
zip5_august has about 900 records, 1 variable. addr_100m_zip9_zip5 has about 1 million records with 70 variables. I want to make sure that the way I'm doing this is best practice.
Is it best practice to have the smaller dataset listed first? Both are sorted accordingly, will the substr() cause much more processing time? Would it be better to set up another field? It's a monthly file that doesn't get used much. I'd prefer not to make too many changes as this server is fairly bogged down already.
Any input or suggestions are welcome.
Thanks,
Go Pirates.
Not necessary, but you asked for optimzation, and an indexed join will usually perform better than a sort/merge join. Especially when the ratio of hits/total rows is as low as in your example.
The message means that SAS could use multi threading (that sort is done in parallel using multiple cores/CPUs). Good, but not surprising.
I would index prop_zip_code.
Use options msglevel =i; to verify it's being used.
I'll have to look that up. I'm not familiar with msglevel = i. I ran a small subset of each dataset and see this:
NOTE: SAS threaded sort was used.
I'm not sure what that means. Is an index necessary if it is sorted on prop_zip_code?
Not necessary, but you asked for optimzation, and an indexed join will usually perform better than a sort/merge join. Especially when the ratio of hits/total rows is as low as in your example.
The message means that SAS could use multi threading (that sort is done in parallel using multiple cores/CPUs). Good, but not surprising.
Excellent. Thanks!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: