BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Astounding
PROC Star

Here are a few more ideas to consider.

1. You already sorted the data, and paid the price.  Can it be kept in order in the future so that sorting will not be necessary again?  For example, instead of appending additional observations, can new observations be interleaved into the proper (sorted) location?

2. Do you need all combinations of matches and mismatches?  Or do you only need to find observations in the new batch of data that do not match the master data set?  Especially if your new batch of data is smaller than the master, you might treat your new batch as a hash table and bring in the unsorted master data with a SET statement to make comparisons.

3. A format instead of a hash table would use less memory.  The format could translate the key (or concatenated keys, if more than one) into the observation number within the data.  Then in a DATA step:  (a) concatenate the keys from the other data set (if there are two keys), (b) use the format to identify the matching observation number, (c) use SET with POINT= to retrieve that matching observation number (renaming variables along the way).  On a side note, both formats and hash tables must be stored in memory.  When the hash table has only one piece of data attached to it, the amount of memory is comparable.  But since you need the hash table to retrieve roughly 30 variables, it will require more memory than the format.

As you can see, approaches to a solution depend on knowledge of the data, and knowledge of the problem being solved.

Good luck.

SergioSanchez
Calcite | Level 5

Astounding, I'll keep in mind your advices Smiley Wink.

Thanks

SAS Innovate 2025: Call for Content

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 31 replies
  • 14371 views
  • 10 likes
  • 12 in conversation