Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AW: AW: st: RE: SAS Transport


From   Dan Blanchette <dan.blanchette@duke.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: AW: AW: st: RE: SAS Transport
Date   Tue, 31 Mar 2009 16:40:37 -0400 (EDT)

-fdause- will read SAS variable labels so I think Ben Allaire was
talking about SAS user-defined formats (the equivalent to Stata's
value labels).  -fdasave- will create a SAS xport file formats.xpf
which is a SAS xport dataset that contains the value label information
but in a dataset format. -fdause- will load user-defined formats (value labels) from a formats.xpf, but the file has to have been created by -fdasave-. Since SAS user-defined formats can be a whole lot more complex than Stata value labels, I think that Stata has this restriction since if Stata created formats.xpf then it must not contain the complexities that Stata can't handle.


I just wrote -dat2vlab- that will help in situations like Ben's
if formats.xpf (or whatever the file is called since SAS will
name an xport dataset file with any or no file extension) exists
and contains the formats/value labels for the actual dataset.

 . fdause formats.xpf
 . isid fmtname start
 . destring start, replace
 . dat2vlab , name(fmtname) value(start) label(label)
 . label save using "saslabs.do"
 . fdause mydata.xpt
 . do "saslabs.do"

Not sure if -dat2vlab- is worth publishing to the SSC, but let me
know if you're interested in -dat2vlab-.


Best,

Dan Blanchette
Research Associate
Center of Entrepreneurship and Innovation
Duke University's Fuqua School of Business
dan.blanchette@duke.edu

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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