MatchUp Object:Read-Write:Match Key

From Melissa Data Wiki
Jump to navigation Jump to search

← MatchUp Object Reference

MatchUp Object Read-Write Interface Navigation
Order of Operations
Match Key

These functions take the real data being compared and construct a match key according to the mappings defined with the Mapping functions and the matchcode defined when the Read/Write deduper was initialized.


This function clears all values from previous calls to the AddField or ReadRecord function. The application should call this function after calling the WriteRecord function, before the first call to the AddField function, or before each call to the ReadRecord function.

Syntax mdMU->ClearFields()
C mdMUReadWriteClearFields(mdMU)
.Net mdMU.ClearFields


This function passes the contents of a field from a database to the deduper prior to calling the BuildKey function.

Fields must be passed to this function in the same order that the corresponding data types were mapped using the AddMapping function.

The following example expands on the previous AddMapping example. The matchcode uses five-digit ZIP codes, last and first names, in that order, and the street addresses. The list includes only a single “City/ST/ZIP" and a single full name field.

mdMU->AddField("Rancho Santa Margarita, CA 92688")
mdMU->AddField("Raymond F. Melissa")
mdMU->AddField("Raymond F. Melissa")
mdMU->AddField("22382 Avenida Empresa")

The deduper would use only the ZIP Code from the first field, the last name from the second AddField and first name from the third AddField.

Syntax mdMU->AddField(char)
C mdMUReadWriteAddField(mdMU, char)
.Net mdMU.AddField(string)


This function builds a match key using information passed via the AddField function.

The match key is built from:

  • Information passed via calls to the AddField function.
  • Mapping defined by the AddMapping function.
  • The pattern defined by the matchcode being used.

A match key is a character string built according to a pattern defined by the current matchcode, consisting only of enough information to determine if the current record is unique or has a duplicate within the key file.

For example, let’s assume the matchcode called for a five-digit ZIP Code, first ten characters of a last name, first ten of a first name, a street number and the first ten characters of a street name. The current record is for Raymond F. Melissa at 22382 Avenida Empresa in the 92688 ZIP Code. The match key would be:


Because “Empresa” is only seven characters, the key would be padded with three spaces at the end.

Syntax mdMU->BuildKey()
C mdMUReadWriteBuildKey(mdMU)
.Net mdMU.BuildKey


This function accepts a match key before calling the ReadRecord function.

The BuildKey function creates a key from input data. If, however, the match keys are already stored in the source database, use this function to pass the keys to the deduper before calling MatchRecord.

Syntax mdMU->SetKey(char)
C mdMUReadWriteSetKey(mdMU, char)
.Net mdMU.SetKey = string


This function accepts a character value that uniquely identifies each record in a set of data. The character value passed to this function must be unique for every record. This enables the application to associate the match key in the key file to the corresponding record in the list.

Syntax mdMU->SetUserInfo(char)
C mdMUReadWriteSetUserInfo(mdMU, char)
.Net mdMU.SetUserInfo = string


This function creates a record of the current key and user info and writes it to the key file. This function requires that either the BuildKey or SetKey function, plus the SetUserInfo function, have previously been called. Then this function writes the information stored by the previously listed functions to a new record in the current key file.

The application cannot call this function after the Process function has been called.

Syntax mdMU->WriteRecord()
C mdMUReadWriteWriteRecord(mdMU)
.Net mdMU.WriteRecord