*! version 1.0.0 9oct2016

Title

save12 -- Save Stata 12 dataset

Syntax

Save data in memory to file in Stata 12 format

save12
filename
[, options]

options

nolabel omit value labels from the saved dataset

replace overwrite existing dataset

all save e(sample) with the dataset; programmer's
option

Description

save12 provides a consistent command to save datasets in Stata 12 format,
which facilitates collaboration between computers using different versions
of Stata. Stata 12 and later versions of Stata can produce datasets in Stata 12
format, but not using the same command. save12 assures that the same code
shared across multiple computers will save datasets in Stata 12 format,
regardless of the host computer's version of Stata.

save12 stores the dataset currently in memory on disk in Stata 12 format
under the name filename. If filename is not specified, the
name under which the data were last known to Stata (c(filename)) is used.
If filename is specified without an extension, .dta is used. If your
filename contains embedded spaces, remember to enclose it in double
quotes.

save12 has been tested to work in Stata 12, 13 and 14. It will continue to
work correctly in future versions of Stata so long as they maintain the same
saveold syntax as Stata 14, with an option of version(12).
Stata 11 can read datasets in Stata 12 format, but cannot write datasets in
Stata 12 format.

Options

nolabel omits value labels from the saved dataset.
The associations between variables and value-label names, however,
are saved along with the dataset label and the variable labels.

replace permits save12 to overwrite an existing dataset.

all is for use by programmers. If specified, e(sample) will
be saved with the dataset. You could run a regression; save12 mydata, all;
drop _all; use mydata; and predict yhat if e(sample).

Author

Michael Stepner

stepner@mit.edu