Announcement

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

  • Use sas data in stata

    Dear Statalisters,

    I have sas 9 and stata 13 installed on my pc. I have a sas dataset with 3.9 million observations. To bring sas data into stata

    I use sas transport file , it was successful (see log)

    The data set XPORTOUT.IB has 3966889 observations and 3 variables.


    but when I am in stata ,

    fdause "C:\Database\ib.xpt"

    Warning: file C:\Database\ib.transport contains variables with value labels, but value label file
    C:\Database\IBES\formats.xpf or C:\Database\IBES\FORMATS.xpf could not be opened


    I have 2 questions:
    1. Given the warning, is there anything I should do to ensure the data integrity?

    2. give the size of data , is there a better way than using sas transport to bring sas data into stata?

    Thank you,
    Rochelle





  • #2
    SAS 9.1 can save-as Stata directly. That's probably simplest. Nowadays, I wouldn't bother with transport files, unless you are moving them around Linux/Unix and Windows versions of SAS.

    I think that all the warning is telling you is that the labels didn't come over. To check, it wouldn't hurt to run PROC MEANS and/or PROC FREQ and compare the results to sum and tab in Stata.

    Comment


    • #3
      Rochelle:
      far from being an advertising stunt, I've found that StatTransfer (https://www.stattransfer.com/) can easily manage all the transport file issues at a reasonable price.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        @ Ben, thank you ! I tried

        proc export data=source.ib outfile= "C:\Database\ib.dta";
        run;

        it works, my variable analy was string in sas, now it is converted to double, this could create problems .

        is there any way to specify the variable types and ensure it is the same type after converting to stata?

        for variables with leading zero as string, the zero will be dropped when saved as double in stata.


        @Carlo,thank you ! I thought statatranfer requires purchases.

        Rochelle

        Comment


        • #5
          Stat/Transfer does cost money. But it is some of the best money I have ever spent. I don't use it that often but when I do it saves me all sorts of time and trouble.

          Various tips on freebie otions are available at

          http://www3.nd.edu/~rwilliam/stats/s...nversions.html
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

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

          Comment


          • #6
            Yes, I have to agree with Richard Williams. StatTransfer is one of the best investments a data analyst can make. I have yet to encounter a data format that it can't handle. It's blindingly fast even on very large files. And it takes care of all the details like value labeling, etc. Plus their customer service is, like Stata's, outstanding. And, to boot, it's not all that expensive. (No, I don't own any stock in the company, nor any other conflict of interest here. What you're seeing is my genuine enthusiasm for the product.)

            Comment


            • #7
              Thank you Clyde !

              Comment

              Working...
              X