Generates a pattern for a string using a pattern analysis 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. |
DQ.PATTERN(pattern_def, input, result)
pattern_def
a string representing the name of a match definition in the QKB
input
a string representing the input value or input field name
result
a string representing the output field name
The DQ.PATTERN function generates a pattern for the input string and outputs the pattern to a field. The pattern is a simple representation of the characters in the input string. Such patterns can be used to perform pattern frequency analysis for a set of text strings.
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 and the QKB locale setting.
When calling DQ.PATTERN you must specify the name of a pattern analysis definition. A pattern analysis definition is an object in the QKB that contains logic used to generate a pattern for the input string. Refer to your QKB documentation for information about which pattern analysis definitions are available in your QKB.
dq dataq
string output
dataq = dq_initialize()
dataq.loadqkb("ENUSA")
dataq.pattern("Character", "abc123", output)
// Outputs "aaa999"