{smcl}
{.-}
help for {cmd:outdat}
{.-}

{title:Export data to other statistical packages}

{p 8 27}
	{cmd:outdat}[{it:varlist}] {cmd:using} filename [{cmd:,} {cmd:replace} 
	{cmdab:t:ype}{cmd:(}{it:packagelist}{cmd:)}]
	{cmdab:nost:ring} {cmdab:listwise}

{title:Description}

{p} {cmd:outdat} writes data to a disk file in ASCII format, a format
that can be read by other programs.  To read the data into other
programs you need a data dictionary, which is also produced by
{cmd:outdat}.

{p} The ASCII file written by {cmd:outdat} is called filename with the
extension {cmd:dat}. The data dictionary is also called filename, but
with the extension for the data dictionary of the specific software you
want to use.  If you want to use SPSS, for example, the dictionary is
called filename{cmd:.sps}.

{p} To transfer data to a SQL-Database {cmd:outdat} creates a file,
containing the SQL INSERT instructions to load each row into a
preexisting table. The name of this table is the filename without the
path of the file. That is, {cmd:using ~/path/to/file/xyz} implies
"xyz" as the name for the table. To produce SQL-Tables check out
the option {cmd:create}.

{p} It must be noted that some Stata features (long variable names,
case sensitivity, etc.) cannot be handled in all packages. You may use
{help rename} before executing {cmd:outdat} for such data. But also
note that it is easy to edit the dictionary to fit more specific
requirements of the software to which you transfer. 

{title:Options}

{p 0 4} {cmd:replace} permits outdat to overwrite an existing
filename.dat and dictionary file. As always {cmd:replace} cannot
be abbreviated.

{p 0 4} {cmdab:t:ype}{cmd:(}{it:packagelist}{cmd:)} is used to specify
the software packages you want to transfer to. You specify the
software packages by their names in lower case letters with spaces in
between. To get data dictionaries for SPSS and Stata you have to
specify {cmd:type(spss stata)} for example.

{cmd:spss} is the default if you do not specify this option.

{p 4 4} The following packages can be specified: 

{p 8 16} {cmd:limdep} Limdep  (not tested!)
{p_end}
{p 8 16} {cmd:spss} SPSS
{p_end}
{p 8 16} {cmd:sql} SQL-Databases (Oracle, mySQL) 
{p_end}
{p 8 16} {cmd:stata} Stata
{p_end}
{p 8 16} {cmd:rats} RATS  

{p 4 4} This list will be expanded sooner or later. 

{p 0 4} {cmdab:nost:ring} forces outdat not to transfer string
variables. This is useful as some packages cannot handle string
variables.

{p 0 4} {cmdab:listwise} is used to transfer only observations with no
missing values on any of the specified variables. 

{p 0 4} {cmdab:up:per} is used to transfer variable names in upper
case.  Without upper the variable names are transfered as they
are. For {cmd:type(sql)} this also changes the case of SQL-commands and
filenames.

{p 0 4} {cmdab:cre:ate} has a special meaning only with
{cmd:type(sql)}.  {cmd:type(sql)} without {cmd:create} produces a
script to input the data in a preexisting table of the SQL
Database. With {cmd:create} you get another script to setup the table
itself. Note that {cmd:create} does not produce an error if you use it
together with another package than SQL. It simply gets ignored.

{title:Examples}

{p 8 16} {cmd:outdat using mydata}
{p_end}
{p 8 16} {cmd:outdat mpg hdroom foreign using auto, t(spss)}
{p_end}
{p 8 16} {cmd:outdat using mydata, t(sql stata) nostring listwise create}
{p_end}


{title:Author}

{p 8} ukohler@sowi.uni-mannheim.de

{title:Acknowledgements}

{p} The extensions for RATS and SQL builds on {help torats} and
{help tosql} written by Christopher Baum.

{title:Also see}
{p 0 21}
On-line: help for
 {help outfile},
 {help infile}

