Pagecontract silencing error

For questions regarding programming in the EViews programming language.

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

BigD
Posts: 28
Joined: Wed Jan 04, 2017 7:05 am

Pagecontract silencing error

Postby BigD » Wed Jan 25, 2017 1:32 pm

Hi,

I'm using pagecontract to filter out stuff in different series using a for loop. My filter is that if their percentage difference is beyond a certain threshold, it is added into the series. And then I'd group those.

The thing is, some series may not have any difference in numbers so the percentage difference would be 0. Then pagecontract will have an error popping up saying that the workfile contraction would leave no observations. And it's fine by me so I want to silence this error and let the rest of the program run.

Here's my code for the percent difference calculation portion:

Code: Select all

'loops through series list for !j=1 to chgename.@count 'calculates percentdiff for the last 10 years smpl @last-9 @last %seriesnam = chgename.@seriesname(!j) series b{%seriesnam} = @abs(({%seriesnam}_01 - {%seriesnam}) / (({%seriesnam} + {%seriesnam}_01) / 2)) * 100 'filters the series pagecontract @last-9 @last if b{%seriesnam} > !threshold and b{%seriesnam} <> na adds series to a group aresults.add b{%seriesnam} next
Any help is appreciated. Thanks!

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

Re: Pagecontract silencing error

Postby EViews Gareth » Wed Jan 25, 2017 2:18 pm

Did you try the setmaxerrs command?

BigD
Posts: 28
Joined: Wed Jan 04, 2017 7:05 am

Re: Pagecontract silencing error

Postby BigD » Thu Jan 26, 2017 7:37 am

Hmm I don't think so. I'll take a look at that and try it. Thanks :D


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests