*! version 1.1 06 March 2012
help for convertdataversion 1.1 (06 March 2012)

Title

convertdata -- (batch) convert datasets using the external tool Stat/Transfer

Table of contents

Syntax
Description
Options
Remarks
examples
Author
Also see

Syntax

convertdata, fromextension(extension) toextension(extension) [options]

fromextension(extension) file extension of source

toextension(extension) file extension of target

inputdirectory(directory) directory to read files from

outputdirectory(directory) directory to write files to

mkoutputdirectory create directory

command(path) Stat/Transfer terminal command

replace overwrite existing files

filename(filename) single file conversion only

Description

convertdata (batch) converts files using the external tool Stat/Transfer from one dataset type to another.

Options

Main

fromextension(extension) convert files from extension. All dataset file types supported by Stat/Transfer could be used, whilst only dta is heavily tested. extension should not be specified with leading period.

toextension(extension) convert files to extension. All dataset file types supported by Stat/Transfer could be used, whilst only sav is heavily tested. extension should not be specified with leading period.

inputdirectory(directory) convert all files with given extension, as specified in fromextension(extension), found in directory.

Note that directory should not contain a trailing slash, and should not be enclosed in (compound) double quotes.

If inputdirectory(directory) is specified but directory is not accessible or does not exist, the working directory is used instead and a warning message is triggered.

outputdirectory(directory) convert all files with given extension, as specified in fromextension(extension), and save them to directory.

Note that directory should not contain a trailing slash, and should not be enclosed in (compound) double quotes.

If outdir(directory) is specified but directory is not accessible or does not exist, the working directory is used instead and a warning message is triggered.

mkoutputdirectory create directory, as specified in outpitdirectory(directory), before converting files. If directory already exists, option mkoutputdirectory is ignored.

command(path) use the Stat/Transfer terminal program located in path for conversion. If not specified, convertdata will try to guess path by your operating system by looking for the standard installation directory.

Note that path must be the full path to the st or st.exe executable file, not the GUI version stattransfer or StatTransfer.exe.

replace replace output files without warning. No need to mention that you should be careful with this option.

filename(filename) instead of batch converting multiple files from one directory, convert a single file named filename only.

Note that filename should be specified without file extension.

This clearly could be achieved quite simple by just using Stat/Transfer directly or in combination with Statas shell command.

Remarks

For obvious reasons, this command needs a valid installation of Stat/Transfer by Circle Systems. There is no sense in using this command without it.

Stat/Transfer is a registered trademark of Circle Systems. Neither NEPS nor the author is in any way affiliated with Circle Systems, but we use their product.

It is recommended that even if you use Windows, you use forward slashes (/) rather than backward slashes (\) for specifying directory names.
Stata will understand and there will then be no clash with other meanings for the backward slash.

This command is part of the NEPmgmt bundle, written to help creating the NEPS dataset files.

The source code of the program is licensed under the GNU General Public License version 3 or later.
The corresponding license text can be found on the internet at http://www.gnu.org/licenses/ or in gnugpl.

Examples

Convert all Stata datasets in working directory to SPSS datasets:

. convertdata, fromextension(dta) toextension(sav)

Convert all Stata datasets in directory /home/user/Desktop/Stata to SPSS datasets in directory /home/user/Desktop/SPSS:

. convertdata, fromextension(dta) toextension(sav) indir(/home/user/Desktop/Stata) outdir(/home/user/Desktop/SPSS)

Convert all Stata datasets in directory /home/user/Desktop/Stata to SPSS datasets in directory /home/user/Desktop/SPSS

and create the output directory if necessary:

. convertdata, fromextension(dta) toextension(sav) indir(/home/user/Desktop/Stata) outdir(/home/user/Desktop/SPSS) mkoutdir

Author

Daniel Bela (daniel.bela@lifbi.de), Leibniz Institute for Educational Trajectories (LIfBi), Germany.

Also see

Help: NEPSmgmt, http://www.stattransfer.com/