Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Stata commands "version" and "saved results"

From   Marco Ercolani <>
To   "" <>
Subject   st: Stata commands "version" and "saved results"
Date   Tue, 18 Jan 2011 11:53:54 +0000

Dear Statalisters,

I need a command that returns an integer for the version of Stata anyone is using.
I then want to use this integer to decide what save command to implement, 
along the lines of:

if e(V)>=10: saveold  dataset.dta
if e(V)<0: save dataset.dta

I know that many commands exists to ask Stata what version is running but the 
manuals do not document if any of these commands produce "saved results":


. version
version 11.1

. display c(version)

. about
Stata/MP 11.1 for Windows (64-bit x86-64)
Born 04 Nov 2010
Copyright (C) 2009 StataCorp LP

This following simple solution does not work because it still saves the data as version 10:

version 9.2: save dataset.dta


Dr Marco G. Ercolani
Department of Economics
University of Birmingham
Edgbaston, B15 2TT
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index