Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Why my codes run well on version 9.1 but not on version 10


From   Phil Schumm <pschumm@uchicago.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Why my codes run well on version 9.1 but not on version 10
Date   Thu, 25 Feb 2010 08:12:31 -0600

On Feb 25, 2010, at 6:38 AM, Quang Nguyen wrote:
We have a small program which run well on Stata version 9.1. However, when we run it on Stata/SE 10, there is a message like " recode only runs with numeric variable". We check and find that Stata just automatically drop some variables in the in-between steps. This happens as we run the program as a whole. If we run the program comand by comand it works well. Do you know wht amight cause this, and what is the solution.


Your question is impossible to answer without additional information -- you'll need to step through your do-file bit-by-bit (e.g., use - exit-), comparing the results obtained under 9.1 to those obtained under 10 at each step to locate the exact source of the discrepancy. At that point, someone here can help explain the cause of the difference, if necessary.

Three quick comments. First, have you used -version 9.1- at the top of your do-file? Using -version- is the single best (and easiest) way to make sure that code written for one version of Stata will continue to run under new versions. Second, are you calling any 3rd party commands from within your do-file? If so, it's possible that one of these commands is behaving differently under Stata 10 than under Stata 9.1 (note that use of -version- within your do-file will not affect this). Finally, you mentioned that "If we run the program comand by comand it works well." I assume here that you are referring to selecting portions of the file and choosing "Run" -- note that this differs from executing the do-file continuously from the beginning in several important ways (e.g., local macros are lost and the last - preserve- is automatically restored each time control is returned to Stata). For this reason, this is not a good way to debug. Instead, use -exit- to stop the script at various points along the way (but always run continuously from the beginning), as described above.


-- Phil

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index