Title

callst -- Call StatTransfer from Stata

Syntax

callst [path_el]
[, destination(path_el) config(SToptions) ]

Description

callst invokes StatTransfer to copy data to and from Stata data files (ie, extension .dta).

In general, to get non-Stata data files into and out of Stata, it will be easier to use the commands that do that directly: usel, savel, collect, finddata.
But, to create a translation of a data file, this will usually be easier than opening up StatTransfer.

The command's main parameter is the source, or data file to be translated. When the transfer is from an ODBC data source (and only then), no main parameter is supplied.

For setting the default behavior of StatTransfer when used from Stata, see Remarks, below.

Options

destination(path_el) specifies a pathname for the newly translated data.
If destination() is not specified, the new name and location will the the same as the original file, with only the extension changed. (Usually, that would be to .dta)

config(SToptions) passes configuration information along to StatTransfer. There are six possible suboptions:

type(file-type) specifies the format of the foreign data, whether source or destination.
This sub-option is only needed when the file extension is ambiguous (or misleading). see below

keep(varlist) specifies variables from the orignating file to be kept. A Stata varlist should generally work; variables with odd characters should be single-quoted.

drop(varlist) specifies variables from the orignating file to be dropped. A Stata varlist should generally work; variables with odd characters should be single-quoted.

where(expression) is the equivalent of a Stata if clause, specifying observations to keep. The format is slightly different. see below

set(setup-option) passes along StatTransfer SET commands. Any number of set() sub-options may be included in config().
For example: config(set(preserve-case Y) set(read-sas-fmts N)).

copy(table/worksheet/cells/member) specifies, for some file types, which part of the file to use. see below

Remarks

Seems that these remarks, if they ever existed, have been misplaced. In the meantime, see the StatTransfer docs.