Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: from stata to SAS


From   "Joseph Coveney" <[email protected]>
To   "Statalist" <[email protected]>
Subject   Re: st: from stata to SAS
Date   Thu, 4 Oct 2007 11:05:40 -0700

Tim Wade wrote:

I suggest using SAS proc import, which is very flexible, like this:

. sysuse auto.dta
(1978 Automobile Data)

. outsheet _all using test.txt, comma replace noquote

proc import datafile="C:\DATA\test.txt"
out=work.test
dbms=dlm
replace;
delimiter=",";
getnames=yes;
run;

--------------------------------------------------------------------------------

I take it that the -noquote- option is mandatory for a direct-to-SAS path
(as opposed to the Stata-Excel-SAS path that Juzhi was originally trying
for).  It presupposes that none of Juzhi's variables are string containing
an imbedded comma in any observation.  I was led to believe that in such
cases SAS has, er, longstanding known issues
( https://stat.ethz.ch/pipermail/r-help/2007-September/141771.html ),
something about the consequences of Cary being downwind from Redmond.

I haven't followed closely--was there a reason that Juzhi cannot
use -fdasave-?  An advantage is that variable labels will be conveyed.  A
disadvantage is the length limit on variable names.

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index