Bookmark and Share

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


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

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


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Stata commands "version" and "saved results"
Date   Tue, 18 Jan 2011 12:06:45 +0000

I don't understand your question. As your code illustrates, you can
access items such as c(version) directly, so you are not dependent on
whether any command produces them as saved results. -creturn li- gives
this and other constants. It sounds as if you need c(stata_version).
This is all documented in the manuals: [P] is the best place to look.

(And naturally, the result need not be integer.)

Nick

On Tue, Jan 18, 2011 at 11:53 AM, Marco Ercolani
<[email protected]> wrote:

> 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":
>
> Examples:
>
> . version
> version 11.1
>
> . display c(version)
> 11.1
>
> . 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

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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