Working with Different Stata versions commands and data

Why can't I load my Stata dataset with an older version of Stata?

Stata is backward compatible. Newer versions of Stata can read older versions but that is not the case for older Stata dealing with newer versions. Stata’s backwards compatibility works for 1 version away. Meaning Stata15 can read Stata14 data, Stata11 can read Stata10 data, Stata12 has same form as Stata11, but Stata15 can not read Stata11, because 15 and 11 are more than 1 version apart.
There are 2 options to load newer Stata data sets into an older version of Stata.

  1. You can load the new Stata version data set into the old one with “use#”. Where # is the version of Stata that your data was created in.
    Example: My data is of version 13, but I want to load this data into version 10. Perform the command below
    use13 "my_dataset_path&name", clear
  2. You can save to older versions of Stata. Using the “saveold” command.
    Example: My data is of version 15, but I want to save the data so I can use it in Stata11. Perform the command below
    saveold data_name, version(11)

     

    Important: Stata15 can only save back to version 11. To save to an older version you must open data in Stata11 and use saveold again to go to an earlier version.
    Note: I included the “version(#)” option at the end of the “saveold” command. This will be talked about more later on in this FAQ.

Why are my older STATA commands not running like they used to?

Stata is backwards compatible; however, command syntax for a previous version of Stata may not be identical to that of a newer version. You can use “version” to run Stata commands of a specific version. The version command was added for Stata14. Version command can be used in 3 ways.

  1. First, only typing “version” into command prompt will output current Stata version in use.
    Example:
    version *output will be version 16, Stata16 is most recent version on CCSS-RS servers.
    <strong=””>Note: An asterisk “*” in Stata and in this FAQ denote a comment, Stata does not interpret these. Comments are colored with green font</strong=””>
  2. To run a bunch of commands with earlier Stata syntax, use “version #”. Where # is the version of Stata you want following commands to be run under. The “version” command is treated as an umbrella term. Every command underneath the occurrence of “version #” will be run in compliance with Stata#, where # was specified in “version” command
    Example:
    version 11
    *{batch of commands I want to run using version 11}
    version 16 *When complete, return back to version I started with.
  3. Lastly, similar to the point above you can run single commands using an older version using version # : command. Where # is version number and “command” is the specific command you want to run for the specific version specified. This is useful when we are switching between multiple Stata versions for many different commands.Example:
    version 13:command *single command that I will run using Stata13
    version 15:command *single command that I will run using Stata15, likely as a result of previous command
    version 11:command *single command that I will run using Stata11, likely as a result of previous 2 commands