BookmarkSubscribeRSS Feed
raawan
Calcite | Level 5

WHEN IS IT GOOD TO COMBINE MULTIPLE SAS DATASETS BY MATCHING KEY VALUES??

WITH INDEXES ON KEY VALUES OR WITHOUT INDEXES ON KEY VALUES

3 REPLIES 3
PGStats
Opal | Level 21

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.

PG
raawan
Calcite | Level 5

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

Kurt_Bremser
Super User

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 280 views
  • 0 likes
  • 3 in conversation