Announcement

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

  • saveold in Stata 12 and Stata 13 differ

    saveold in Stata 13 saves files in a different format than saveold in Stata 12 (and, annoyingly, without warning). I need a file in the "old" format Stata 12 uses -- because SPSS at my university can only read the older format and I still have a few holdout students who (annoyingly) still use SPSS. Is there a command or user program to get Stata 13 to write in the older format? A work-around is to fire up an old Stata 12, re-run everything, and and save the file there -- but that is a pain in the tail, so something better would be appreciated.

    PS Shame on Stata 13 for not warning -- a colleague and I wasted an hour or two figuring out what the devil was going on (SPSS and Stattransfer moaned about not being able to read a NEWER version of Stata and of course the file involved was huge and had to be emailed and ...etc... ! Normally Stata is really good about version consistency.

    Thank you

    Professor Jonathan Kelley

  • #2
    Well, a lot of stuff is predicated on Stata 11 or even older.

    So you need to do something like:
    version 9
    saveold whatever.dta


    to make sure older software can read it. The file format difference between 12 and 13 was HUGE (yay, long strings!) and the others were more incremental. If you don't have svyset, mi set, or anything else going on, safest is to declare version 9, *then* saveold.

    Comment


    • #3
      ps. Version 9 was the last version the kids could pirate onto their thumb drives just by copying the files. Coincidence? I think not

      Comment


      • #4
        I have a feeling version control does not work with saveold, but you can try it.

        In fairness to Stata Corps, the behavior in question is well documented. If you type -help saveold-, it says

        saveold saves the dataset currently in memory on disk under the name filename in Stata 12 format. Stata 11 can also read Stata 12 datasets.

        If you are using Stata 13 and want to save a file so that it may be read by someone using Stata 11 or Stata 12, simply use the saveold command.
        It is also the behavior I would expect. Unless saveold is always going to save everything in Stata 1 format, what else would you expect the command to do other than to save in the immediately previous file format?

        As far as solutions go, how old is your copy of Stat/Transfer? V. 12 can read Stata V. 13 files, and V. 11 can read Stata 12 files. If the software is older than that I would recommend upgrading as Stat Transfer is a great program, and if you had the latest version right now you would have saved yourself a lot of aggravation!

        Anyway I would suggest (a) Use saveold to save in Stata 12/11 format (b) see if your version of Stat/Transfer can handle it (c) if not, dig out Stata 12 and use saveold again (d) try Stat/Transfer again.

        Or, just go ahead and order the latest Stat/Transfer and download it immediately: http://www.stata.com/order/stat-transfer/dl/

        Or, tell your students that if they insist on using hopelessly inferior software then they are on their own. If they are too lazy to learn Stata they'll probably be failures in life anyway so they might as well save everybody a lot of time and trouble and drop out of school now.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 17.0 MP (2 processor)

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

        Comment


        • #5
          Both these posts are puzzling.

          saveold in Stata 13 saves files in a different format than saveold in Stata 12
          saveold in 13 saves so that 12 can read it; saveold in 12 saves so that 10 or 11 can read it. That follows from documentation: see e.g. http://www.stata.com/help.cgi?dta What Jonathan should expect is that save in 12 is equivalent to saveold in 13. It's certainly documented that the format of Stata datasets changed in Stata 13.

          Ben seems to be thinking, or at least implying, that version can be used to set behaviour to whatever previous behaviour you want, as if each Stata has wrapped up within it all older Statas. Although version can be used to insist on certain old behaviours, as documented at http://www.stata.com/help.cgi?version, I don't think saveold can be reset in this way.

          Comment


          • #6
            OK, I stand corrected. Getting SPSS 21 to read Stata 13 files (regardless of version command and saveold) it barfs. I don't have remote access to the machine I have Stata 9, 10, 11, and 12 installed on for testing and absurdity, but I swear I was able to get older versions of Stata to read newer versions with the addition of the version command prior to saveold. Hmm.

            Comment


            • #7
              saveold in 12 saves so that 10 or 11 can read it.
              Even better than that, actually. I just fired up Stata 12 and the help for saveold says "saveold saves the dataset currently in memory on disk under the name filename in Stata 9/Stata 10 format. Stata 11 has the same dataset format as Stata 10." So I think Stata 12 and, if necessary, even a really ancient version of Stat/Transfer can handle this task. But if you have to constantly cater to a bunch of spoiled millennials who refuse to learn Stata I myself would buy Stat/Transfer.
              -------------------------------------------
              Richard Williams, Notre Dame Dept of Sociology
              Stata Version: 17.0 MP (2 processor)

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

              Comment


              • #8
                I was able to get older versions of Stata to read newer versions
                You mean that you could get Stata x to read Stata y for some y > x? I would counsel against swearing to that. The canonical pattern is that you can save to the previous dataset format, but no more (or rather, no less). Dataset formats have not changed in every release, however, which may lead to an impression of greater compatibility.

                Comment


                • #9
                  I swear I was able to get older versions of Stata to read newer versions with the addition of the version command prior to saveold.
                  Like Nick says, you may have just thought it worked because 9, 10 and 11 used the same format. It would be nice if saveold had a version option. Maybe by Stata 23 it will.
                  -------------------------------------------
                  Richard Williams, Notre Dame Dept of Sociology
                  Stata Version: 17.0 MP (2 processor)

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

                  Comment


                  • #10
                    the file involved was huge and had to be emailed and ...etc.
                    As a sidelight, I think the world would be a better place if everybody started using Google Drive or Dropbox or whatever to email links to their files rather than the files themselves. It certainly helps when the files are monstrous. If you don't already have it you can check out Dropbox at https://www.dropbox.com/referrals/NT...OQ?src=global9
                    -------------------------------------------
                    Richard Williams, Notre Dame Dept of Sociology
                    Stata Version: 17.0 MP (2 processor)

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

                    Comment


                    • #11
                      I'm pretty darn sure you're right. saveold in V12 is apparently a lot more retro-compatible than saveold in V13, and I was merely deceiving myself (and now Dr, Kelley) by thinking that the version command mattered for that purpose. There's always outsheet or outfile...

                      BTW, the new capabilities of V13 should cause your colleagues to seriously consider upgrading. Long strings alone would make me demand V13, much less the other stuff.
                      Last edited by ben earnhart; 08 Jul 2014, 20:39.

                      Comment


                      • #12
                        Good point! There are all these export commands, which I never use. One of the options is sasxport -- I bet SPSS can read that. I am guessing it would be better than other options, but I have never used it so I don't know.
                        -------------------------------------------
                        Richard Williams, Notre Dame Dept of Sociology
                        Stata Version: 17.0 MP (2 processor)

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

                        Comment


                        • #13
                          Come on, sasxport is called fdasave in older versions. But it is cool, since it *is* readable by SPSS, SAS and older versions of Stata and StatTransfer, retaining value labels and such. But that's trivia nobody should need to know.

                          Comment


                          • #14
                            http://www.stata.com/manuals13/dimpo...importsasxport sasxport does have its limits, but might be easier than excel or other formats. I would strongly prefer options discussed earlier. Even though I don't use it that much, this discussion reminds me how useful Stat/Transfer is.
                            -------------------------------------------
                            Richard Williams, Notre Dame Dept of Sociology
                            Stata Version: 17.0 MP (2 processor)

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

                            Comment


                            • #15
                              +1 to Richard -- with the variety of Stata data set formats, saveold indeed should have asversion() option.

                              And please don't assume that one ALWAYS has access to EVERY piece of software under the sun. If you are a faculty at a serious university, this may be the case; students usually have to pay a fee, which they may or may not find justifiable for the education task at hand. Things are different outside of that elite world. At my job, I use a combination of Stata 12, SPSS 21, and SAS 9.3. Conversations with IT to install StatTransfer have been going on for two years; to upgrade Stata, since the release 13 which makes it a year. SPSS 21, which is the most recent version released this year (I believe), can only read and write Stata 8 (or so it says in the "Save As..." dialogue). saveold in Stata 12 works for SPSS 21, though, as it apparently writes in a format that has not changed since Stata 8.
                              -- Stas Kolenikov || http://stas.kolenikov.name
                              -- Principal Survey Scientist, Abt SRBI
                              -- Opinions stated in this post are mine only

                              Comment

                              Working...
                              X