Stata 15 help for dta_equal

Title

[P] dta_equal -- Assert datasets equal

Syntax

dta_equal filename1 filename2 [, options]

dta_equal . filename2 [, options]

options Description ------------------------------------------------------------------------- exclude(varnames) exclude varnames from comparison uniq1 exclude variables unique to filename1 from comparison uniq2 exclude variables unique to filename2 from comparison noneok it is okay if no variables in common after exclusions -------------------------------------------------------------------------

Description

The dta_equal certification command slowly but surely compares filename1.dta with filename2.dta, variable by variable, and aborts with error r(9) if they differ. If filename1 is specified as period (.), filename1 is taken to be the data in memory.

Displayed are variables unique to filename1, in alphabetical order; variables unique to filename2, in alphabetical order; and variables in common, in alphabetical order.

dta_equal returns only r(0) if all variables, after exclusions, contain equal values in the two datasets.

If filenames are specified without a suffix, .dta is assumed.

Options

exclude(varnames) excludes the listed variable names from the comparison. Names must be entered one after the other in unabbreviated form.

uniq1 excludes variables unique to filename1 from the comparison. If this option is not specified, unique variables cause error r(9).

uniq2 excludes variables unique to filename2 from the comparison. If this option is not specified, unique variables cause error r(9).

noneok specifies that it is okay if all variables are excluded. If this option is not specified, the presence of no common variables results in error r(9).

Stored results

dta_equal stores the following in r():

Macros r(common) common variables, in alphabetical order r(uniq1) variables unique to filename1, in alphabetical order r(uniq2) variables unique to filename2, in alphabetical order


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index