Page 1 of 1
Ignore error message in for- loop
Posted: Wed Jun 17, 2009 6:53 am
by Katjes
I'm have a for loop over several countries, and want to estimate a binary equation for each country. The problem is that Eviews stops running if for one of the country an error occurs (typically "Quasi linear prediction"). How can I manage that Eviews simply skips the country (I don't know in advance which country it will be), and run the estimation for the following countries?
I tried to implement the !new_count = @errorcount but it doesn't helps!
Re: Ignore error message in for- loop
Posted: Wed Jun 17, 2009 8:05 am
by EViews Gareth
Set the error count to a large number, then run your program.
Re: Ignore error message in for- loop
Posted: Wed Mar 19, 2014 8:42 am
by misscats
I also have the same problem. My codes are shown below.
eq_cg_32 gives an error message. I would like to skip it and continue to have results of eq_cg_33 and eq_cg_34 (the actual loop for !i is larger, here is an example)
However, with my codes, the error message jumps out and the program stops. I only get results of eq_cg_30 and eq_cg_31. I should have results of eq_cg_33 and eq_cg_34 as well.
Your help will be much appreciated.
Code: Select all
for %j cg
for !i=30 to 35
!old_count = 0
equation eq_{%j}_{!i}.ARCH(THRSH=1,GED,ARCHM=VAR,DERIV=AA) {%j}{!i} C INDEPVARS @ DUMMY1
!new_count = @errorcount
if !new_count> !old_count then return
else
freeze(tab_{%j}_{!i}) eq_{%j}_{!i}.stats
tab_{%j}_{!i}.save tab_{%j}_{!i}
endif
next
next
Re: Ignore error message in for- loop
Posted: Wed Mar 19, 2014 9:07 am
by EViews Gareth
Did you set your maximum number of errors to a large number?
Re: Ignore error message in for- loop
Posted: Wed Mar 19, 2014 9:12 am
by misscats
Hi Gareth
Thank you for your quick reply.
I am sorry that I don't know how (and where?) to set my maximum number of errors. Please indicate me more information.
Very much appreciated.
Re: Ignore error message in for- loop
Posted: Wed Mar 19, 2014 10:15 am
by misscats
Hi Gareth
I finally knew how to solve it. Please forgive me as a beginner.
My Eviews version is Eviews 7. There is no command code called setmaxerrs. Therefore, the information is outdated and no any updating posts available.
After clicking the run button for programming, the pop-out dialog has one section is the set up for maximum number of errors. I didn't notice that and ran thousand times. Now I changed the default to 50 and it works.
Many thanks for your help.