DQ.MATCHCODE Function

Generates a match code for a string using a match definition in the QKB.

Category: Data Quality
Returned data type: Integer
Note: The returned value is a Boolean value where 1= success and 0 = error.

Syntax

DQ.MATCHCODE(match_def, sensitivity, input, result)

Required Arguments

match_def

a string representing the name of a match definition in the QKB.

sensitivity

integer numeric constant that specifies the sensitivity level to be used when generating the match code [possible values are 50–95].

input

a string representing the input value or input field name.

result

a string representing the output field name.

Details

The DQ.MATCHCODE function generates a match code for an input string and outputs the match code to a field. The match code is a fuzzy representation of the input string. It can be used to do a fuzzy comparison of the input string to another string.
The function is a member of the data quality class. A data quality object can be declared as a variable and must then be initialized through a call to the function DQ_INITIALIZE. The member function DQ.LOADQKB must then be called to load the contents of a QKB into memory and link that QKB with the data quality object. The data quality object then retains information about the QKB locale setting and the QKB locale setting.
When calling DQ.MATCHCODE, you must specify the name of a match definition. A match definition is an object in the QKB that contains context-specific reference data and logic used to generate a match code for the input string. Refer to your QKB documentation for information about which match definitions are available in your QKB.
You must also specify a level of sensitivity. The sensitivity indicates the level of fuzziness that is used when generating the match code. A higher sensitivity means that the match code is less fuzzy (yielding fewer false positives and more false negatives in comparisons). A lower sensitivity means that the match code is more fuzzy (yielding fewer false negatives and more false positives in comparisons). The valid range for the sensitivity parameter is 50–95.

Example

data quality dq
 string output
dq = dq_initialize()
 dq.loadqkb("ENUSA")
 dq.matchcode("Name", 85, "John Smith", output)
 // Outputs match code "4B~2$$$$$$$C@P$$$$$$"
 
dq.matchcode("Name", 85, "Johnny Smith", output)
 // Outputs match code "4B~2$$$$$$$C@P$$$$$$"