MatchUp Object:Incremental:Initialization

From Melissa Data Wiki
Jump to navigation Jump to search

← MatchUp Object Reference

MatchUp Object Incremental Interface Navigation
Overview
Order of Operations
Functions
Initialization
Mapping
Match Key
Comparison
Key File
Transaction



The following functions prepare the Incremental interface for use and link it to its supporting data files.

SetPathToMatchUpFiles

String value. This function accepts a string value containing the path to the folder containing the MatchUp data files. It must be called before calling the InitializeDataFiles function.

To provide maximum compatibility with Windows, three files are installed in your ‘Common App Data’ directory:

Windows Vista and newer
C:\ProgramData\MelissaDATA\MatchUp.
Windows XP
C:\Documents and Settings\All Users\Application Data\Melissa DATA\MatchUp.

The location of this directory can be changed by users so please note this, as it can often be the source of issues when running the samples/demos.

Syntax mdMU->SetPathToMatchUpFiles(char)
C mdMUIncrementalSetPathToMatchUpFiles(mdMU, char)
.Net mdMU.SetPathToMatchUpFiles = string


SetLicenseString

This function passes the License Key required for MatchUp Object to function. A value of "1" is returned if the License Key is valid, a vlue of "0" is returned for an invalid or empty string.

This function is only required if the environment variable method is not used.

Each customer is issued a License Key when purchasing MatchUp Object or renewing a subscription. This string must be passed to this function to unlock the functionality of MatchUp Object.

The license string is normally set using an environment variable, either MD_LICENSE or MD_LICENSE_DEMO. Calling this function is an alternative method for setting the License Key, but applications developed for a production environment should only use the environment variable.

When using an environment variable, it is not necessary to call this function.

For more information on setting the environment variable, see Entering Your MatchUp Object License Key.

Syntax int = mdMU->SetLicenseString(char)
C int = mdMUIncrementalSetLicenseString(mdMU, char)
.Net integer = mdMU.SetLicenseString string


SetMatchcodeName

This function selects the matchcode to use for the current Incremental deduping operation. It accepts a string value that must match the name of an existing matchcode in the current matchcode file.

Syntax mdMU->SetMatchcodeName(char)
C mdMUIncrementalSetMatchcodeName(mdMU, char)
.Net mdMU.SetMatchcodeName = string


SetMatchcodeObject

This function selects the matchcode to use for the current Incremental deduping operation.

This function largely duplicates the purpose of the SetMatchcodeName function, but instead of accepting a character value containing the name of a matchcode in the current matchcode file, this function accepts a Matchcode object created using the Matchcode Editing interface.

Because this function requires a separate interface to create the Matchcode object variable, it is normally easier to use the SetMatchcodeName function.

It is possible, however, to use this function to build a new matchcode on the fly using the Matchcode Editing interface. Unless a specific application demands such flexibility, it is usually much simpler to add a new matchcode to the matchcode file using the Matchcode Editor and call it using the SetMatchcodeName function.

Syntax mdMU->SetMatchcodeObject(mdMUMatchcode)
C mdMUIncrementalSetMatchcodeObject(mdMU, mdMUMatchcode)
.Net mdMU.SetMatchcodeObject = mdMUMatchcode


SetMustExist

This function determines whether or not the path specified by the SetKeyFile function must point to an existing key file.

If this option is set to true, initialization of MatchUp Object will fail if the path specified in the SetKeyFile function does not point to an existing key file.

If this option is false, and the path specified in the SetKeyFile function does not point to an existing key file, a new empty key file will be created.

Syntax mdMU->SetMustExist(bool)
C mdMUIncrementalSetMustExist(mdMU, bool)
.Net mdMU.SetMustExist = boolean


SetKeyFile

This function selects the name and file path for the key file that will be used for the current Incremental deduping operation.

If the SetMustExist function has been set to True, the string value passed to this function must contain a valid path to an existing key file.

If the SetMustExist function has been set to False, MatchUp Object will create an empty key file if none is found during initialization.

Syntax mdMU->SetKeyFile(char)
C mdMUIncrementalSetKeyFile(mdMU, char)
.Net mdMU.SetKeyFile = string


SetReserved (Deprecated)

Optional. This function accepts two parameters: A string parameter containing the property to be set; and a string parameter representing the value for the property being set.

It must be called before calling the InitializeDataFiles function.

The unique identifier set by SetUserInfo and attached to built match keys is 1024 bytes by default. Overriding this size with SetReserved(“UserInfosize”,”size”) is deprecated for the Incremental interface and a call to this method will be ignored. Newer Incremental key storage mechanisms have made this parameter obsolete.

Syntax mdMU->SetReserved(char, char)
C mdMUIncrementalSetReserved(mdMU, char, char)
.Net mdMU.SetReserved(string)


SetMaximumCharacterSize

Optional. This function will accommodate UTF-8 input data. Since a single UTF-8 character can be up to 4 bytes long, the storage of the matchcode keys may need to be altered to accommodate this maximum size. However, if you are working in a part of the world where you are sure that a byte sequence will always be shorter, you can use this function to override the storage overhead.

It must be called before calling the InitializeDataFiles function.

Valid input values are 1, 2, 3 or 4. Invalid values will be ignored and the default size (e.g. if this function is not called) is 1.

Syntax mdMU->SetMaximumCharacterSize(int)
C mdMUIncrementalSetMaximumCharacterSize(mdMU, int)
.Net mdMU.SetMaximumCharacterSize(integer)


SetEncoding

Optional. This function define encoded format of the input file and the resultant format of the build keys. Input data is converted into the UTF-8 format and processed as such. When GetKey is called, the data is converted back from UTF-8 to the specified input format.

The return value is 1 if the desired encoding can be set or 0 if the encoding is not recognized or can not be set.

It must be called before calling the InitializeDataFiles function.

The default encoding type is "ISO-8859-1", if this function is not used.

Syntax mdMU->SetEncoding(char)
C mdMUIncrementalSetEncoding(mdMU, char)
.Net mdMU.SetEncoding(string)


InitializeDataFiles

This function opens the needed data files and prepares the MatchUp Object for use.

Before calling this function, the code must have successfully called the SetLicenseString, SetMatchcodeName (or SetMatchcodeObject) and SetPathToMatchUpFiles functions.

Check the return value of the GetInitializeErrorString function to retrieve the result of the initialization call. Any result other than “No Error” means the initialization failed for some reason.

This returns a value of the enumerated type ProgramStatus.

Value Enumeration Description
0 ErrorNone No error - Initialization was successful.
1 ErrorConfigFile Could not find mdMatchUp.dat.
2 ErrorLicenseExpired The License Key has expired.
3 ErrorDatabaseExpired The database has expired.
4 ErrorMatchcodeNotSpecified No matchcode was specified.
5 ErrorMatchcodeNotFound Specified Matchcode does not exist.
6 ErrorInvalidMatchcode The specified matchcode is not valid.
7 ErrorKeyFile The specified key file was not found.

If any other value other than "ErrorNone" is returned, check the GetInitializeErrorString function to see the reason for the error.

Syntax ProgramStatus = mdMU->InitializeDataFiles()
C ProgramStatus = mdMUIncrementalInitializeDataFiles(mdMU)
.Net ProgramStatus = mdMU.InitializeDataFiles


GetInitializeErrorString

This function returns a string to describe the error caused when the InitializeDataFiles function cannot be successfully called.

The possible strings returned by this function are:

  • "No error"
  • "Could not find mdMatchUp.dat."
  • "The License Key has expired."
  • "The database has expired."
  • "No matchcode was specified."
  • "Specified Matchcode does not exist."
  • "The specified matchcode is not valid."
  • "The specified key file was not found."
Syntax char = mdMU->GetInitializeErrorString()
C char = mdMUIncrementalGetInitializeErrorString(mdMU)
.Net string = mdMU.GetInitializeErrorString


GetBuildNumber

This function returns the current development release build number of MatchUp Object.

Syntax char = mdMU->GetBuildNumber()
C char = mdMUIncrementalGetBuildNumber(mdMU)
.Net string = mdMU.GetBuildNumber


GetDatabaseDate

This function returns a string value that represents the revision date of the MatchUp Object data files.

Syntax char = mdMU->GetDatabaseDate()
C char = mdMUIncrementalGetDatabaseDate(mdMU)
.Net string = mdMU.GetDatabaseDate


GetDatabaseExpirationDate

This function returns a string value containing the expiration date of the current database file (mdMatchUp.dat).

Syntax char = mdMU->GetDatabaseExpirationDate()
C char = mdMUIncrementalGetDatabaseExpirationDate(mdMU)
.Net string = mdMU.GetDatabaseExpirationDate


GetLicenseExpirationDate

This function returns a string value containing the expiration date of the current License Key. After this date, MatchUp Object will no longer function.

Syntax char = mdMU->GetLicenseExpirationDate()
C char = mdMUIncrementalGetLicenseExpirationDate(mdMU)
.Net string = mdMU.GetLicenseExpirationDate