Announcement

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

  • convert stata dataset to sas dataset

    Dear all,

    I have a stata dataset with a 1million observations that needs to be converted to sas dataset so I can share with a collaborator who uses sas only (9.4 for windows). I am running stata 17.

    Could you give some advice? Thanks !


    Rochelle

  • #2
    Stata can export files in SAS Xport format. Can he read those? I would try that first.

    You could also try rioweb, but your file may be too big:

    https://gallery.shinyapps.io/rioweb/

    If worse came to worst, you could probably export in csv format.

    If you're willing to spend some money you can get stat/transfer:

    https://stattransfer.com/

    I only use it a few times a year but it is incredibly useful when I do.



    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Thank you Richard !

      He was not able to read xpt file. I created csv file, hopefully it works.

      Best,

      R.

      Comment


      • #4
        Originally posted by Rochelle Zhang View Post
        He was not able to read xpt file.
        If your Stata dataset contains Unicode characters, then use the SAS Version 8 export, which produces a SAS dataset with .v8xpt as the file extension.

        The Version 5 SAS export file format (i.e., with the .xpt file extension) cannot handle Unicode.
        Code:
        help export sas
        and then click on the export sasxport8 hyperlink in the popup screen.

        Comment


        • #5
          In my experience the best way to transmit files between coauthors is through text files, comma or tab delimited.

          Every software has the ability to import text files.

          Even Stata itself changes the dta data format, so often times I am out of sync with my coauthors regarding which version of Stata we are using. E.g., right now I am on Stata 15, if you send me your Stata 17 dta file, I might, or more likely might not be able to read it on my Stata 15.

          Comment


          • #6
            Thanks Joro, my csv file works !

            Comment


            • #7
              Thanks Joseph for the tip on xpt sas !

              Comment

              Working...
              X