SAVETO9 - a utility to convert Stata 10-12 data to Stata 9 format

Description


SaveTo9 facilitates access to datasets in recent Stata formats to programs that only support Stata datasets in older formats (for example SPSS).

Stata Version DTA Specification Dataset Marker (first byte)
8.0-9.2 113 "q" 0x71h
10.0-11.2 114 "r" 0x72h
12.0-12.1 115 "s" 0x73h
13.0 117 does not contain conventional version marker

SaveTo9 supports datasets produced by Stata 10, 11, or 12. It does not support datasets produced by Stata 13.

Installation instructions

SaveTo9 is a .Net program. It is designed to work in MS Windows, but should be able to run in Linux and Mac provided that Microsoft .Net Framework or it's alternative is installed on these machines. See Mono. The minimum version of .Net is 2.0. If you have Windows Vista or newer, your system already has .Net installed. For Windows XP Microsoft .Net Framework can be acquired from Microsoft's website for free.

SaveTo9 is completely standalone. It does not require users to have Stata, SPSS, or any additional conversion programs like Stat/Transfer or DBMS/Copy.

No special installation process is required. SaveTo9 is completely portable. Just start the executable file, which you can download here: saveto9.exe

Usage

The program can be used from command line to facilitate batch processing:

  saveto9 "inputfile.dta" "outputfile.dta"

If no arguments are supplied, the program will work interactively. If one argument is supplied, the program will work interactively, but will pre-load the first argument as the input file value. If both arguments are supplied, the program will pre-load both of them, then run the conversion and terminate without the user involvement.

There are no other options in this program that control the conversion process.

If the conversion terminates abnormally, the error code can be seen in the dialog. In the batch mode the error code is returned through the usual mechanism and can be picked up with ERRORLEVEL

Note to SPSS users

Starting from version 14.0 of SPSS it supports import of Stata datasets directly through menus and syntax command GET STATA. However this facility was not updated for recent versions of Stata and at SPSS version 22 the maximum specification of dta supported is still 113. If Stata is available, a Mata program -savespss- allows saving dataset directly in the SPSS system file format. -savespss- is platform-independent and also works with Stata 13 (though it currently does not output the long strings added in that version of Stata).

Example


Here is how we convert our standard auto.dta created in Stata 10 (dta specification 114) to format compatible with Stata 9 (dta specification 113).

If you don't have Stata installed, the example file is available online here: auto.dta, and here is the file created in Stata 12: auto.dta.

First start the program:


Click the first Browse... button and select the file to be converted. Note the icon appearing next to the input file name. It shows the version of Stata that created the dataset.


Click the second Browse... button and select where the resulting file should be saved. Note the arrow on the convert button becomes green.


Press Convert and check the result of conversion.


If Stata 9 or higher is installed on your computer, you can click the icon to open the resulting dataset.

Author

In case you are experiencing a problem converting a dataset, and you think the error is mine, kindly let me know.

SaveTo9 was written by Sergiy Radyakin. To contact the author send email to sradyakin/at/worldbank.org.

Or write to Statalist