You are here: Commands > Verify

Verify

Menu: Found in the ANALYZE menu

Use the Verify command to check for data validity errors in the current table.

Verify is often one of the first commands used when dealing with a new table. Verify ensures that data in a file conforms to the table layouts and reports on any errors encountered.

The Verify command uses the table layout description to check the specified fields for data validity errors. All defined fields may be analyzed to ensure that the data is consistent with the specified field type. For example, Verify checks that only character data is in character fields and numeric data in numeric fields.

The Verify command offers an option to specify that any empty field values (nulls, blanks or zeros) encountered are to be ignored when verifying data validity. This is particularly useful where blank values are expected (such as blank dates in a date field).

Character fields are checked for unprintable characters and numeric fields are checked for improper numeric characters. For example, Verify checks for more than one preceding ‘+’ or ‘‑’ sign or more than one decimal point.

Note: When verifying fields in variable record length files, fields which start beyond the current record length are deemed invalid. This results in the record number, field name and the message “Field starts beyond end of record” being included in the Command Log tabular output for the Verify command.

There are preferences for the Verify command that will cause Analyzer to verify all existing fields every time you open a table or replace invalid data in numeric fields with blanks. For more information, see Numeric Options.

Note: Turning the Verify Data preference on slightly slows down Analyzer as it first verifies the data.

Analyzer also provides a function to test for valid data in a field. For more information see VERIFY().

This command can be auto-executed. For more information on the Autoexecute Commands preference, see Command Options.

Parameters

In addition to the command parameters described below, the Verify command has the following command parameters: Append, First, If, Next, To and While. For a description of these parameters, see Command Parameters. For a description of supported field modifiers see Field Modifiers.

Fields to Verify

Specifies the fields or expressions to be verified. In the command dialog, select the fields from the “Fields to Verify” list box or click [Choose] to display the Selected Fields dialog. Although you can check for their validity, computed fields, along with ad hoc expressions and binary fields, are by definition always valid. For more information, see Selection/Edit Dialog Boxes.

Errorlimit

Specifies the number of errors allowed before the command is terminated. In the command dialog, enter the number of errors in the “Stop processing after...” text box. The default is 20. Can also be set in the Command Line for the Verify Command as ErrorLimit n.

To change the default setting globally, select Tools from the menu and choose Options. Click the [Command Options] tab and increase or decrease the number in the Errorlimit text box.

Using a Zero Error Limit in a Procedure

There may be situations where you want to test the validity of a chosen table before processing and to escape the procedure gracefully if the table is found to be invalid.

set default

set safety off

delete all OK

open table1

verify all errorlimit 0

if write1>0 pause "The chosen table is not valid, too many data errors detected."

if write1>0 return

comment - if the table is valid, enter commands below for processing the table

This example procedure can be modified to continually ask the user for a valid table until one is selected - contact Arbutus Support if you need assistance.

Ignore Empty Fields

Specifies that any empty field values (nulls, blanks or zeros) are to be ignored when verifying data validity. This is particularly useful where blank values are expected (such as blank dates in a date field).

Command Mode Syntax

VERIFY field-list

<IF test> <WHILE test> <FIRST|NEXT range>

<NOBLANKS> <ERRORLIMIT n>

<TO text-file-name|SCREEN>¿

Examples

To verify the validity of data in reference to the table layout, use Verify. If you are unsure about the integrity of the data, you should always run the Verify command before detailed processing of any table.

1. Open the desired table layout.
2. Click Analyze in the menu and choose Verify.
3. Select all of the fields in the list box.
4. Accept the default Error Limit of 20.

Analyzer displays the result in the Command Log in tabular format.

Analyzer displays the record location and field containing the invalid data, along with the actual field contents and its hexadecimal representation. You can click on the Record number to see the full record in the View (the record is highlighted).

Note: When verifying fields in variable record length files, fields which start beyond the current record length are deemed invalid. This results in the record number, field name and the message “Field starts beyond end of record” being included in the Command Log tabular output for the Verify command.

You can also use the Dump command to review the contents of each invalid record. See Dump for details.