Tag: hash object

Optimize many-to-one mapping by user-defined functions

In many occasions, fast access into a lookup table to find desired value is necessary. In computer science, linked list, associative array, and hash table are widely used to construct the relationship between values and keys. Hash function, like value…

The efficiency of five SAS methods in multi-dataset merging

Introduction: Merging two or multiple datasets is essential for many ‘data people’. Yes, it is a dirty and routine job. Everyone wants to get it done quick and accurate. Actually, SAS has many ways to tackle this job[3]. In two competing papers fro…

Table Look Up in SAS, practical problems

One guy asked in a SAS forum about a typical table look up problem:
He has a data with two IDs:
id1 id2
a b
a e
b c
b e
c e
d e

and he wants to generate a new data set with the following structure according to above information :
id a b …

Tweak PROC FASTCLUS for 1-Nearest Neighbor / Closest Match

In most table lookup tasks, we are doing EXACT matching. However, sometimes we are looking for closest match in the lookup table. By ‘closest’, we mean smallest Eucleadian distance:

||X-Y||2

Typically we have to manually code the search function …