Dear Roger,
another workaround (which may also be used within do files) is
cd "C:\Program Files\StatTransfer7\";
shell st /o /y auto.dta "my auto.xls";
This avoids the necessity of using quotes for the DOS command name.
You should also consider (which is the way, I decided to use) to copy all
basic StatTransfer files into your working directory do use the above shell
command without the prior change directory.
The necessary StatTransfer files are:
- LICENSE.DAT
- st.exe
- stadev32.dll
- statrn32.dll
- stutil.dll
Kind regards,
Christian Holz
Research Analyst | HBS Consulting GmbH
tel: +49 341 215 4549 | Tomasiusstrasse 2, D-04109 Leipzig, Germany
fax: +49 341 215 4521 | www.hbs-consulting.com
cell +49 172 792 3672 | [email protected]
> I think I have discovered an unwanted new feature of the -shell- command,
> at least in the 01 July 2004 version of Stata 8.2 under Windows 2000. It
> appears not to work when both the DOS command path and the filename are
> enclosed in quotes.
>
> For instance, if the user has StatTransfer 7 installed in a folder
>
> C:\Program Files\StatTransfer7\
>
> and has the auto data in a file auto.dta in the local directory, then the
> command
>
> shell "C:\Program Files\StatTransfer7\st" /o /y auto.dta my_auto.xls
>
> will create a Microsoft Excel version of the auto data in the file
> my_auto.xls. However, the command
>
> shell "C:\Program Files\StatTransfer7\st" /o /y auto.dta "my auto.xls"
>
> will not create a Microsoft Excel version of the auto data in a file "my
> auto.xls". The problem is the quotes and not the embedded spaces in the
> filename (which make the quotes necessary), because the command
>
> shell "C:\Program Files\StatTransfer7\st" /o /y auto.dta "my_auto.xls"
>
> does not create a Microsoft Excel version of the auto data in a file
> my_auto.xls.
>
> This feature of -shell- is specific to the -shell- command syntax
>
> shell operating_system_command
>
> because, if I simply type
>
> shell
>
> and open a DOS window and then, in that DOS window, type
>
> "C:\Program Files\StatTransfer7\st" /o /y auto.dta "my auto.xls"
>
> then a Microsoft Excel version of the -auto- data is created in the file
> "my auto.xls".
>
> This feature of the -shell- command has partially disabled my -stcmd-
> package, which is downloadable from SSC and also shipped with official
> StatTransfer 7, but which will no longer work with filenames in quotes,
> which used to cause no problems. I personally would never define a
> filename
> containing spaces (and therefore necessitating quotes), but some of my
> SPSS-using collaborators do this with the .sav files which they send me.
> (As a quick and dirty fix, I suppose I always could rename these .sav
> files, substituting underscores for blanks.)
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/