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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.