Ignore error message in for- loop

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Katjes
Posts: 58
Joined: Thu Oct 02, 2008 5:46 am

Ignore error message in for- loop

Postby Katjes » Wed Jun 17, 2009 6:53 am

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!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Ignore error message in for- loop

Postby EViews Gareth » Wed Jun 17, 2009 8:05 am

Set the error count to a large number, then run your program.

misscats
Posts: 29
Joined: Wed Mar 19, 2014 8:37 am

Re: Ignore error message in for- loop

Postby misscats » Wed Mar 19, 2014 8:42 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Ignore error message in for- loop

Postby EViews Gareth » Wed Mar 19, 2014 9:07 am

Did you set your maximum number of errors to a large number?

misscats
Posts: 29
Joined: Wed Mar 19, 2014 8:37 am

Re: Ignore error message in for- loop

Postby misscats » Wed Mar 19, 2014 9:12 am

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.

misscats
Posts: 29
Joined: Wed Mar 19, 2014 8:37 am

Re: Ignore error message in for- loop

Postby misscats » Wed Mar 19, 2014 10:15 am

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.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests