Announcement

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

  • Does 'version' command remove need for 'saveold'?

    Does using the "version" command eliminate the need to use the "saveold" command?

    That is, if I need to make some v12 data using v14, do I have to change every save command to saveold, or will one "version 12" at the top of the .do file mean that every dataset created by that .do file will automatically be saved as v12 style data?
    Last edited by Garret Christensen; 22 Jun 2016, 17:58. Reason: saveold, version, saving data

  • #2
    One way to find out . . .

    .ÿversionÿ12

    .ÿ
    .ÿclearÿ*

    .ÿsetÿmoreÿoff

    .ÿ
    .ÿsysuseÿauto
    (1978ÿAutomobileÿData)

    .ÿ
    .ÿsaveoldÿF:\test
    (savingÿinÿStataÿ13ÿformat)
    (FYI,ÿsaveoldÿhasÿoptionsÿversion(12)ÿandÿversion(11)ÿthatÿwriteÿfilesÿinÿolderÿStataÿformats)
    fileÿF:\test.dtaÿsaved

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .

    Comment


    • #3
      Sorry misread your question. Here:

      .ÿversionÿ12

      .ÿ
      .ÿclearÿ*

      .ÿsetÿmoreÿoff

      .ÿ
      .ÿtempfileÿtmpfil0

      .ÿ
      .ÿquietlyÿsaveÿ`tmpfil0',ÿemptyok

      .ÿtypeÿ`tmpfil0'
      <stata_dta><header><release>118</release>ÿ[remainderÿredacted]

      .ÿ
      .ÿexit

      endÿofÿdo-file


      .ÿ


      Given the remarks here, you can see the answer.

      Comment


      • #4
        Thanks. That took me a second, but that's a bummer. (Release 118 is Stata 14.) This seems unfortunate, in my opinion. Maybe the "version" command help file should be updated to say that it doesn't work for saving.

        Comment


        • #5
          As Nick Cox is fond of saying, version control is not a time machine. Placing a -version- command in a file does not transform Stata into a previous version of itself. What it does do is allow the syntax parser to accept older versions of the syntax and respond to it with the closest thing available in current Stata. This means that programs written for earlier versions of Stata will still continue to run. They will usually produce highly similar results, although if changes since the earlier version constitute corrections of bugs, the earlier buggy behavior will not be reproduced. Also some commands use different estimation algorithms than they did previously, and in general -version- does not resurrect the older algorithms. So results sometimes differ slightly for this reason as well.

          All that -version- guarantees about the -save- command is that older syntax for -save- will be recognized and its nearest equivalent will be executed. But it does not result in a change in the version of the data file that the -save- command produces. I've been using Stata since version 4, and as far as I can tell any syntax that was valid between then and now still is today, even without version control. (A few new options have been added to -save- over the decades, but it is basically unchanged.)

          -saveold- is basically a convenience command that allows people who are using current Stata to send Stata data files to people who are one or two versions behind them. As long as the data file structure keeps being revised with new versions, I think we will always need it.

          Comment


          • #6
            To put Clyde's message in rather different form, the help for version explains what it does. It is best thought of as an umbrella under which certain specific older syntax is allowed. There is absolutely no claim that it reinstates all older behaviour, even all legal behaviour.

            Comment


            • #7
              I like to think of version control to be all about the future not about the past. Then version ensures code written for older releases will continue to work in future releases, not the other way round. Thus, there is no need to explicitly mention that code written in Stata 14 (including saved files) will not necessarily work with Stata 12.

              Best
              Daniel

              Comment


              • #8
                It would make me nervous if version control caused Stata 14 files to be saved in Stata 11 format, at least if it did so without a warning. You could potentially lose something in the translation. Also even the new saveold only allows you to go back to Stata 11 format. Personally I was thrilled when saveold was improved in Stata 14, and would not want version control for save to work this way with it.
                -------------------------------------------
                Richard Williams, Notre Dame Dept of Sociology
                StataNow Version: 19.5 MP (2 processor)

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

                Comment

                Working...
                X