Compare the contents of the current workfile or page with the contents of a different workfile, page or database.
Syntax
wfcompare(options) targetspec baselinespec [@keep keeplist @drop droplist]
The command shows a list of any differences between the objects specified by targetspec and those specified by baselinespec.
targetspec should be a specification of objects in the current workfile. It should take the form of [page\]name_pattern, where the optional page\ may be used to specify a specific page of the current workfile. name_pattern is used to list the objects you wish to compare. The typical form of targetspec is simply “*”, meaning to compare all objects in the current workfile.
baselinespec should be a specification of the list of objects to compare against. It should take the form of [container::page\]name_pattern, where the optional container::page\ may be used to specify the name of the workfile or database or page containing the objects to compare against. name_pattern is used to list the objects you wish to compare against. If baselinespec is blank, the version of the current workfile stored on disk is used as the baseline.
The optional @keep and @drop lists allow you to narrow further the list of objects in targetspec by listing specific objects to compare (using @keep), or drop from the targetspec (using @drop).
Options
tol=arg | Specifies the threshold below which differences between the target and baseline values should be ignored. The threshold is specified as a fraction of the baseline value. For example, if tol=1%, one or more observations in the target object must differ from their values in the baseline object by at least one percent for the objects to be reported as different. The default tolerance is 1e-15. |
seterr | Set an error if any differences exceeding the specified tolerance were found. This option may be useful in batch programming to alert the user if a program causes unexpectedly large changes to data values. |
list=key | Selects which objects should be included in the output list. key may be “a” (list objects that exist in the target but not baseline), “d” (list objects that exist in the baseline, but not target), “r” (list objects that exist in both but have different objects types), “c” (list objects that exist in both but have different frequencies), “m” (list objects that exist in both but have values that differ by more than the tolerance), “u” (list objects that exist in both and are unchanged), “s” (list objects that exist in both but cannot be compared). |
out=name | Create a table object name, containing the comparison table. |
nohead | Used with “out=” option to suppress the header row at the top of the frozen table. |
Examples
wfcompare
Compares the current workfile with the previously saved version of the workfile on disk. All pages are compared.
wfcompare *_0 *_1
compares all in the current page with names ending with “_0” with all objects whose names ends in “_1”.
wfcompare page1\* page2\*
compares all objects in page1 of the current workfile with those in page2.
wfcompare page1\* page2\* @drop GDP UNEMP
compares all objects except for the objects “GDP” and “UNEMP” in page1 of the current workfile with those in page2.
wfcompare * myfile.wf1
compares the contents of the current page with the contents of the same page in the saved workfile 'myfile.wf1'
wfcompare *\* jun2012.wf1
compares the contents of all pages in the current workfile in memory with all pages of the saved workfile “Jun2012.WF1”.
wfcompare page2\x* test.edb::y*
compares all objects in page2 of the current workfile whose name begins with the letter “x” to all objects in the database test.edb whose name begins with the letter “y”.
Cross-references