Profiler Object:Report Mode

From Melissa Data Wiki
Jump to: navigation, search

← Profiler Object Reference

Profiler Object Navigation
System Requirements
Order of Operations
Using Append Mode
Using Report Mode

You can open an existing profiling file in Report Mode (read only) without any change to the order of operation except for the SetAppendMode that needs to be set AppendModeReport. The Profiler will ignore any column specifications or rules (example: SetColumnCustomPattern, SetColumnValueRange, SetColumnDefaultValue, SetColumnSize, SetColumnPrecision or SetColumnScale) or any new records. The following pseudo-code shows the order of operation with only the necessary code to open the Profiler file in Report Mode.

1. Create an instance of the Profiler object.

Create profiler as New Instance of mdProfiler

2. Set path to the profiler data files.

CALL SetPathToProfilerDataFiles WITH DataPath

3. Call the SetFilename function to set the Profiler file you want to open on Report Mode.

CALL SetFileName WITH ExistingFile

4. Set Append Mode to Report.

CALL SetAppendMode WITH AppendModeReport

5. Call the SetLicenseString function to set the License Key. This was supplied by your Melissa Data Representative.

CALL SetLicenseString WITH LicenseString

6. Configure the InitializeDataFiles function to connect the profiler object to its supporting data file.

CALL InitializeDataFiles RETURNING Result
IF Result IS 0 THEN
  CALL GetBuildNumber RETURNING BuildNumber
  CALL GetDatabaseDate RETURNING DBExpireDate
  CALL GetLicenseExpirationDate Returning LicenseExpireDate
  CALL GetInitializeErrorString RETURNING ErrorString
  Print ErrorString

7. After initializing the data files, the values stored in the Profiler file opened for read are now available. You may now retrieve the Metadata stored when you did the first profiling run (for example: table name, user name, job description, etc.). The field counts and field names can be retrieved as follows:

CALL GetColumnCount RETURNING ColumnCount
FOR Index =0 to ColumnCount-1
CALL GetColumnName  WITH Index RETURNING ColumnName

8. You may also retrieve settings set when the Profiler file was created.

CALL GetColumnCustomPatterns RETURNING ColumnCustomPatternsString
CALL GetColumnValueRange RETURNING ColumnValueRange
CALL GetColumnDefaultValue RETURNING ColumnDefaultValue
CALL GetColumnSize RETURNING ColumnSize
CALL GetColumnPrecision RETURNING  ColumnPrecision
CALL GetColumnScale RETURNING ColumnScale

9. CALL the list of required functions to get the profiled values. These functions have been categorized into three different sections: table, column, and iterator get functions.

For example:

CALL GetColumnMostPopularCount WITH ColumnName RETURNING Int
CALL GetTableRecordCount RETURNING Int
Personal tools