VERIFY command
Concept Information
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:
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:
|
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:
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.