help for dbmscopybatch Amadou B. DIALLO: The World Bank.
-------------------------------------------------------------------------------
Data conversion utility. Creates a log/batch file for DBMS Copy.
dbmscopybatch , path(string) dpath(string) log(string) in(string) out(string) [version(#) options(string) call ]
where :
path is the directory where the files to be transfered are stored,
dpath is the directory where the DBMS Copy executable is stored,
log is the name of the log file (stored in "path"),
in is the type of original dataset to be transfered,
out is the type of final dataset,
version is the version of DBMS Copy, with default 7,
options optionally adds options (embedded in double quotes) to the log/batch file (to be executed by DBMS Copy), call is an option to make Stata invoke DBMS Copy (available only for Window > s Operating Systems).
Description
dbmscopybatch is a routine to create a log (also called a batch) file for DBMS Copy.
When you have a lot of datasets to convert to other formats, doing it interactively in DBMS Copy could be painful and time consuming. Stata will automatically create a log (batch) file which could be run (see run or open batch in DBMS Copy menus).
Remarks
Using dbmscopybatch requires knowing extensions allowed by DBMS Copy. See DBMS manuals. Most known are ASCII (.dat, .prn or .txt), SPSS (.sav), SAS (.sas7bdat) and Stata (.dta).
Examples
. local path "..\Data\Countries\"
. local dpath "..\DBMS\V7\"
. cd "`path'"
. local datas "country1 country2"
. dbmscopybatch `datas', p(`path') d(`dpath') l(dbmscopylog) i(spsswin) o(stata7) v(7) c
. dbmscopybatch `datas', p(`path') d(`dpath') l(dbmscopylog) i(spsswin) o(stata7) v(7) opt("keep if region==1; keep if sex=2; keep if age>=60")
Author
Amadou Bassirou DIALLO, Poverty and Health Specialist. AFTPM, The World Bank. Email: adiallo5@worldbank.org
Aknowledgements
I would like to thank Roger Newson for suggesting this program and Yulia Marchenko of StataCorp for her support.
Also see
Manual: [R] shell, [R] winexec.
Online: help for cd, dir, mkdir and copy if installed.