COMPARE.FILES

COMPARE.FILES

Top  Previous  Next

 

The COMPARE.FILES command compares the content of two files.

 

 

Format

 

COMPARE.FILES {{DICT} file1 {{DICT} file2}} {DETAIL}

 

where

 

file1, file2are the names of the files to be compared. If omitted, the command prompts for the file names. Either or both file names may have the DICT prefix to reference the file's dictionary.

 

 

The COMPARE.FILES command compares the records in file1 with those in file2. If no differences are found, the value of @SYSTEM.RETURN.CODE on completion will be zero. If there are records with differences or records that appear in only one of the files, @SYSTEM.RETURN.CODE will be set to the number of failing records.

 

With the DETAIL option, the command will show details of the differences found.

 

 

Example

 

COMPARE.FILES CUSTOMERS CUSTOMERS.OLD DETAIL

Data mismatch in 10007

  Field 2 differs

Records in file 1 but not in file 2:

  19403

  19766

Records in file 2 but not in file 1:

  04655

Differences in 4 records