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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: continue loop if file not found


From   Patricio Cuarón <patriciocuaron@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: continue loop if file not found
Date   Fri, 6 May 2011 21:04:42 -0300

Thanks to you both. This is the code:

			capture noisily : use $HEREGOESTHEFILENAME, clear
			if _rc == 601 {
				continue, break
			}

On Fri, May 6, 2011 at 5:54 PM, daniel klein
<klein.daniel.81@googlemail.com> wrote:
> I understand that you do not want the do file to terminate, so
> -continue- (alone) will not help.
>
> You propably want to use -capture- prefix.
>
> Try to code somehting like:
>
> cap use filename`date'.dta
> if _rc continue
>
> See -help capture-
>
> Best
> Daniel
> *
> *   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/
>

*
*   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