version 3.1.0
complete_datasignature¶
complete_datasignature creates a signature for a Stata .dta-file or .dtas frameset that does not depend on the embedded timestamp but does depend on the data and, optionally, no other metadata, variable and value labels only, or all metadata.
complete_datasignature extends Stata's datasignature by allowing the inclusion of different sets of metadata. When called with frameset_file, it signs every frame in a .dtas frameset and returns a concatenation keyed by frame name.
Syntax¶
complete_datasignature [, dta_file("file.dta") frameset_file("file.dtas") fname("sigfile.ext") nometa fast labels_formats_only skip_char("globlist")]
By default, complete_datasignature will use the dta-file in memory to create create a signature that depends on the data and all metadata, but not the embedded timestamp.
Options¶
Option |
Description |
|---|---|
dta_file("file.dta") |
Use "file.dta" instead of dta-file in memory |
frameset_file("file.dtas") |
Sign a .dtas frameset; iterate frames alphabetically and return "frameA=sigA |
fname("sigfile.ext") |
write signature to "sigfile.ext" |
nometa |
Do not include any metadata -- equivalent of Stata's datasignature |
labels_formats_only |
Include variable formats, variable and value labels |
fast |
use _datasignature in fast mode -- faster but not machine-independent |
skip_char("globlist") |
Skip variable/dataset characteristics whose names match any pattern in the space-separated globlist. The frameset_file path always adds frlink*_ to this list. |
Behavior of frameset_file¶
When frameset_file is set, the program:
In interactive mode (c(mode) is empty), saves all in-memory frames to a temporary .dtas so user state can be restored on exit. In batch mode, this round-trip is skipped.
Loads the target .dtas via frames use, clear.
For each frame in alphabetical order, computes a per-frame signature using the same metadata options (nometa, fast, labels_formats_only) plus skip_char("frlink*")_.
Assembles "frameA=sigA|frameB=sigB|...".
In interactive mode, restores the user's frames from the temporary .dtas, including the previously-active frame.
Example(s)¶
. sysuse auto
(1978 automobile data)
. datasignature
74:12(71728):3831085005:1395876116
. complete_datasignature, nometa
74:12(71728):3831085005:1395876116
. complete_datasignature, labels_formats_only
74:12(71728):3831085005:1395876116:2144891519
. complete_datasignature
74:12(71728):3831085005:1395876116:711253444
. ret li
macros:
r(signature) : "74:12(71728):3831085005:1395876116:711253444"
. _datasignature, fast
74:12(71728):3831085005:186045760
. complete_datasignature, nometa fast
74:12(71728):3831085005:186045760
. complete_datasignature, frameset_file("myframeset.dtas")
census=74:12(71728):...|housing=50:12(...):...
Stored results¶
r(signature) signature calculated by complete_datasignature