Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Import SAS data directly in Stata

    Hi,

    It would make my life significantly easier if I could import SAS files directly to Stata. I'm currently using "sasxport"
    Code:
    import sasxport "test_sas.sas7bdat"
    Note that in SAS, I know how to save files as Stata format. That's not what I'm after. Thanks!

  • #2
    Although I've never used them,* Stat/Transfer comes with a set of user-written ADO files that enable calling it from within Stata. That's the closest to what I think you're after.

    SAS Institute, I believe, keeps its .SAS7BDAT file format a trade secret, and so I doubt that you're going to be seeing any user-written packages anytime soon to read SAS datasets directly into Stata.

    Is your code an example of how you'd like the syntax of an official Stata command to look like? You could always post on the Stata 15 wishlist thread in this forum.

    *I'd recommend going with an .STCMD Stat/Transfer command file for SAS-to-Stata file conversion in bulk prior to starting up Stata to use the datasets. The various Stat/Transfer options are available in its command files, and they provide for fine control over the transfer. A LOG USING statement in such a command file provides for documentation of how the file conversion went. I don't know whether these are available via the ADO commands.

    Comment

    Working...
    X