Hello
I am using the setmaxerrs command to ignore errors and works fine in the majority of the errors encountered. However, it looks like execution is halted when the error is in relation to a for/loop. Is there a way around it? Am I missing something?
Thanks
George
setmaxerrs - syntax error in control statement
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- EViews Developer
- Posts: 562
- Joined: Thu Apr 25, 2013 7:48 pm
Re: setmaxerrs - syntax error in control statement
Hello,
There are about two dozen "critical" errors that halt an EViews program even when setmaxerrs is being used. Most of those errors relate to syntax errors, which cannot be safely ignored and should be fixed in the program. What is the exact error you're receiving?
There are about two dozen "critical" errors that halt an EViews program even when setmaxerrs is being used. Most of those errors relate to syntax errors, which cannot be safely ignored and should be fixed in the program. What is the exact error you're receiving?
Re: setmaxerrs - syntax error in control statement
Hi Matt
I typically encounter these errors when a WF does not exist or a variable is not defined and I reach the point where I have a for-loop command.
Most importantly, what I am trying to do is to continue "executing" the code until the end of the file is reached where I instruct EViews to notify me for the error (push a log file to Oracle database) and then stop. Effectively, what I want to do is to reach the end of the program file regardless of the type of error (even if it is critical or I have not encountered it before). Would that be possible?
Thanks
George
I typically encounter these errors when a WF does not exist or a variable is not defined and I reach the point where I have a for-loop command.
Most importantly, what I am trying to do is to continue "executing" the code until the end of the file is reached where I instruct EViews to notify me for the error (push a log file to Oracle database) and then stop. Effectively, what I want to do is to reach the end of the program file regardless of the type of error (even if it is critical or I have not encountered it before). Would that be possible?
Thanks
George
-
- EViews Developer
- Posts: 562
- Joined: Thu Apr 25, 2013 7:48 pm
Re: setmaxerrs - syntax error in control statement
While there's no way to suppress critical errors, neither of the errors you've mentioned are in the critical category. Is it possible setmaxerrs simply isn't set large enough?
Re: setmaxerrs - syntax error in control statement
Hi Matt
Thanks for your reply.
I get the same error regardless of the setmaxerrs value. I set out below an example code to explain where I typically get the error. If the dataset is missing, EViews stops despite the setmaxerrs. Is there a way for EViews to ignore this error?
Thanks
George
'==========================================
'Sample code
setmaxerrs 10000000
'Define variables
group GroupSales Sales_*
%Variables = GroupSales.@members
'Loop
for %Var {%Variables}
series test_{%Var} = 0
next
Thanks for your reply.
I get the same error regardless of the setmaxerrs value. I set out below an example code to explain where I typically get the error. If the dataset is missing, EViews stops despite the setmaxerrs. Is there a way for EViews to ignore this error?
Thanks
George
'==========================================
'Sample code
setmaxerrs 10000000
'Define variables
group GroupSales Sales_*
%Variables = GroupSales.@members
'Loop
for %Var {%Variables}
series test_{%Var} = 0
next
-
- EViews Developer
- Posts: 562
- Joined: Thu Apr 25, 2013 7:48 pm
Re: setmaxerrs - syntax error in control statement
Ah, I see the problem scenario now. When %Variables is empty because the assignment to it has failed, then the for statement effectively becomes just "for %Var", which is an ill-formed expression and a critical error. Since you cannot suppress this error, your best bet is to alter the program to avoid it, for example,
You can still record in your log that there was an issue with %Variables, for example,
Code: Select all
if @length(%Variables) > 0 then
for %Var {%Variables}
...
next
endif
You can still record in your log that there was an issue with %Variables, for example,
Code: Select all
if @length(%Variables) > 0 then
for %Var {%Variables}
...
next
else
seterr "%Variables was undefined"
endif
Re: setmaxerrs - syntax error in control statement
Thanks Matt. I appreciate the help.
Who is online
Users browsing this forum: No registered users and 13 guests