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

Re: st: from stata to SAS

From   "Tim Wade" <>
Subject   Re: st: from stata to SAS
Date   Thu, 4 Oct 2007 12:38:00 -0400

Joseph, I'm actually not sure if the noquote is necessary or
not--there may be a Proc Import option that will allow them.
Interesting point regarding the commas, I was not aware of that, but
tab delimited files work as well (See below) I am not too familiar
with SAS's Export format so I usually (when I don't have access to
Stat transfer) use a method with Proc Import, or just read in the data
the old fasioned method manually with a data step which is tedious but
good documentation.

proc import datafile="C:\DATA\test.txt"

On 10/4/07, Joseph Coveney <> wrote:
> 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
> ( ),
> 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:
> *
> *
> *
*   For searches and help try:

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