WHEN IS IT GOOD TO COMBINE MULTIPLE SAS DATASETS BY MATCHING KEY VALUES??
WITH INDEXES ON KEY VALUES OR WITHOUT INDEXES ON KEY VALUES
sas/sql will do both, but usually be more efficient with indexed keys. sas datastep programming will also do both, but will require prior sorting when datastes are not indexed.
Note, using CAPITALS online is considered shouting and not welcomed on a public forum.
When combining multiple SAS data sets by matching key values, under which conditions would it be more efficient to use multiple SET statements in a Data Step
A) Each data set contains a large numbers of rows
There are indexes defined for the key(s) being used on both data sets
B) Each data set contains a large numbers of rows
There are no indexes defined on either data set for the keys being used
C)One data set contains a large numbers of rows
One data set contains a small number of rows
No indexes are defined for the key(s) being used on either data set
D) One data set contains a large numbers of rows
One data set contains a small number of rows
Indexes are defined for the key(s) being used on the large data set
If both datasets are too large to fit into available memory, sorting them and using a merge is most efficient.
If one can fit into memory, creating a format (or multiple formats) or using a hash object is best.
Please supply a code example for matching with multiple set statements.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.