Ed Al-Hussainy wrote:
> I disagree - the approach you coded is neat, but requires that an ODBC
> source exists for each specific MS Excel file that Stata uses to read
> from or write to. That compares quite poorly with SAS's export
> procedure.
You don't need a separate DSN for each Excel file in order to do what PROC
EXPORT does:
copy MyExcel.xls C:\Temp\Temp.xls, replace
odbc . . ., dsn("Revolving Excel Workbook")
copy C:\Temp\Temp.xls MyExcel.xls, replace public
You could wrap that in a brief ado-file for convenience, extensibility and
simplicity of use.
> Stata 9's XMLUSE and XMLSAVE allow convenient data transactions with
> the Office 2003 Excel XML format, but they don't permit data output to
> more than one worksheet. It would be very neat if StataCorp or one of
> you Stata gurus extended XMLSAVE to allow output to multiple Excel XML
> worksheets.
There's a lot more to XML than Excel, and it would be even neater if
StataCorp moved -xmluse- and -xmlsave- beyond Excel and its limited horizon.
> Using third-party software packages such as DBMS/COPY and
> Stat/Transfer are convenient when dealing with a small number of
> datasets; however, they are quite difficult to build into an automated
> solution, particularly in a corporate environment where license
> limitations mean that they are not installed on every computer running
> Stata.
You can run Stat/Transfer from within Stata (-help stcmd-) as well as with
its own ST command files. I'm not sure how writing a SAS macro to run PROC
EXPORT would be any less difficult to build an automated solution for a
large number of datasets than writing code in Stata to run Stat/Transfer or
output an ST command file as a log-file and run the command file, invoking
Stat/Transfer with a fuller set of options. (I don't know much about
DBMS/COPY, but I imagine that it has analogous features--it almost seems as
if PROC EXPORT is a wrapper for DBMS/COPY.)
I don't know about how Base SAS and SAS/ACCESS for PC File Formats are
typically licensed in deals made for corporate environments; they're
described in promotional literature as separately licensed, just as Stata
and Stat/Transfer are.
Joseph Coveney
*
* 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/