*! version 0.1 21Feb2024

help for metaxl diff

Title

metaxl diff - flags differences in metadata files

Syntax

metaxl diff
[, options]

Options
Path(dir) is the directory with the metafiles.
Defaults to the current working directory.

pattern(pat) sets the pattern of file names in path
that are included in the analysis. The pattern is based on strmatch and
defaults to *.xlsx. The user should not provide the extension of the file
because only *.xlsx files are allowed.

save(filename) sets the name of the Excel file where the analysis
is saved. The user should not provide the file extension. Defaults to metadiff.xlsx.

replace overwrites existing Excel file.

basefile(filename) sets filename as the base for comparison
between meta files. Defaults to the first in the list of sorted files' names.

diffonly does not display rows where values are equal across
metafiles.

verbose displays information about the progress of the analysis.

chars Include analysis for variables' characteristics. Default
is to not include.

notes Include analysis for variables' notes. Default
is to not include.

recursive recursively searchs directories for files that match
the pattern to include in the analysis.

Description

metaxl diff is a Stata command that performs a consistency
check between metadata saved in multiple Excel files.
The command assumes that the Excel files have the
structure of the file produced by
metaxl extract.
The command flags differences in metadata under
the assumption that information should be consistent
across metadata files. Consistent here
means that metadata in every file should be equal to
that which appears in the basefile. The metadata for all the
remaining files is compared to the one in basefile and flagged if
it is different.

The command saves the consistency analysis in an Excel file, with worksheets for:

- data characteristics (the values and not the differences)
- variables (if they appear in metadata files or not)
- variables' labels, type, format, etc. (if they are different from the base file)
- value labels (checks if every value and label defined are present in metadata files)

The Excel file includes a worksheet with the files' indexes - base for the first file
(which may be changed using option basefile) and f1, f2, f3, etc. for the remaining files. This
index is used in the other worksheets. A worksheet with the count of differences for every worksheet
is also displayed.

Examples

Analyse the differences between metafiles in the directory metadir. Save the analysis to metadiff.xlsx

. metaxl diff, path(metadir)

Analyse the differences between metafiles in the directory metadir. Save the analysis to metadiff.xlsx. Change the base file to be meta02.xlsx

. metaxl diff, path(metadir) basefile(meta02.xlsx)

Analyse the differences between metafiles in the directory metadir. Save the analysis to metadiff.xlsx, replacing the file if it already exists and showing
only values that are different across metafiles.

. metaxl diff, path(metadir) save(metadiff, replace) diffonly

Remarks

Please notice that this software is provided "as is", without warranty of any kind, whether
express, implied, or statutory, including, but not limited to, any warranty of merchantability
or fitness for a particular purpose or any warranty that the contents of the item will be error-free.
In no respect shall the author incur any liability for any damages, including, but limited to,
direct, indirect, special, or consequential damages arising out of, resulting from, or any way
connected to the use of the item, whether or not based upon warranty, contract, tort, or otherwise.

Dependencies

filelist command by Robert Picard

Author

BPLIM, Banco de Portugal, Portugal.

Email: bplim@bportugal.pt

We appreciate your feedback. Comments are welcome!