VERIFY command

Concept Information

Verifying data

Checks for data validity errors in one or more fields in an Analytics table by verifying that the data is consistent with the field definitions in the table layout.

Syntax

VERIFY {<FIELDS> field_name <...n>|<FIELDS> ALL <EXCLUDE field_name <...n>>} <IF test> <WHILE test> <FIRST range|NEXT range> <ERRORLIMIT n> <TO {SCREEN|filename|PRINT}> <APPEND>

Parameters

Name Description
FIELDS field_name <...n> | FIELDS ALL

The fields or expressions to verify. Specify ALL to verify all fields in the table.

Note

By definition, computed fields, ad hoc expressions, and binary fields are always valid.

EXCLUDE field_name

optional

Only valid when verifying using FIELDS ALL.

The field or fields to exclude from the command. EXCLUDE allows you to fine-tune FIELDS ALL, by excluding the specified fields.

EXCLUDE must immediately follow FIELDS ALL. For example:

FIELDS ALL EXCLUDE field_1 field_2 

IF test

optional

A conditional expression that must be true in order to process each record. The command is executed on only those records that satisfy the condition.

Note

The IF parameter is evaluated against only the records remaining in a table after any scope parameters have been applied (WHILE, FIRST, NEXT).

WHILE test

optional

A conditional expression that must be true in order to process each record. The command is executed until the condition evaluates as false, or the end of the table is reached.

Note

If you use WHILE in conjunction with FIRST or NEXT, record processing stops as soon as one limit is reached.

FIRST range | NEXT range

optional

The number of records to process:

  • FIRST start processing from the first record until the specified number of records is reached
  • NEXT start processing from the currently selected record until the specified number of records is reached

Use range to specify the number of records to process.

If you omit FIRST and NEXT, all records are processed by default.

ERRORLIMIT n

optional

The number of errors allowed before the command is terminated. The default value is 10.

TO SCREEN | filename | PRINT

optional

The location to send the results of the command to:

  • SCREEN displays the results in the Analytics display area

    Tip

    You can click any linked result value in the display area to drill down to the associated record or records in the source table.

  • filename saves the results to a file

    Specify filename as a quoted string with the appropriate file extension. For example: TO "Output.TXT"

    By default, the file is saved to the folder containing the Analytics project.

    Use either an absolute or relative file path to save the file to a different, existing folder:

    • TO "C:\Output.TXT"
    • TO "Results\Output.TXT"
  • PRINT sends the results to the default printer

APPEND

optional

Appends the command output to the end of an existing file instead of overwriting it.

Note

You must ensure that the structure of the command output and the existing file are identical:

  • the same fields
  • the same field order
  • matching fields are the same length
  • matching fields are the same data type

Analytics appends output to an existing file regardless of its structure. If the structure of the output and the existing file do not match, jumbled, missing, or inaccurate data can result.

Analytics output variables

Name Contains
WRITEn

The total number of data validity errors in all fields verified by the command.

Examples

Verifying data and specifying an error limit

You verify all of the columns in a table and set the error limit to 10. The command stops processing if 10 data validity errors are detected:

VERIFY ALL ERRORLIMIT 10 TO "ImportErrors.txt"

Remarks

How it works

VERIFY compares the values in one or more fields to the data type specified for each of the fields in the table layout and reports any errors. The command ensures the following:

  • character fields contain only valid characters, and that no unprintable characters are present
  • numeric fields contain only valid numeric data. In addition to numbers, numeric fields can contain one preceding plus sign or minus sign and one decimal point
  • datetime fields contain valid dates, datetimes, or times

For each error that is identified, the record number and field name are output, along with the invalid value in hexadecimal format.