Error : For statement unterminated

For questions regarding programming in the EViews programming language.

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

behnam_nikbin
Posts: 1
Joined: Sat Dec 12, 2015 12:30 pm

Error : For statement unterminated

Postby behnam_nikbin » Sat Dec 12, 2015 12:52 pm

Hello

I want to determine the order of AR and MA in an ARFIMA model but when I run it at the end I face the problem of " For statement unterminated in "FOR !R=1 TO 11" !!! I want to know why it's going to be like that? And, how to get rid of it ....

Thank you very much

Code: Select all

scalar m=10 'ar scalar n=10 'ma series function=r_total_index matrix (m+1,n+1) A matrix (m+1,n+1) B ls function c matrix A(1,1) = @AIC matrix B(1,1) = @SC %ma="" 'ar=0 just ma for !j = 1 to n %ma=%ma+"ma("+@str(!j)+")" ls function c %ma matrix A(1,!j+1) = @AIC matrix B(1,!j+1) = @SC next %ar="" 'ma=0 just ar for !i = 1 to m %ar=%ar+"ar("+@str(!i)+")" ls function c %ar matrix A(!i+1,1) = @AIC matrix B(!i+1,1) = @SC next for !i = 1 to m for !j = 1 to n %ma="" %ar="" for !k=1 to !j %ma=%ma+"ma("+@str(!k)+")" next for !d=1 to !i %ar=%ar+"ar("+@str(!d)+")" next ls function c %ar %ma matrix A(!i+1,!j+1) = @AIC matrix B(!i+1,!j+1) = @SC next next scalar a_min=@min(a) scalar b_min=@min(b) for !r=1 to 11 for !c=1 to 11 if B(!r,!c) = b_min then scalar qbsc=!c scalar pbsc=!r endif next next for !r=1 to 11 for !c=1 to 11 if A(!r,!c)=a_min then scalar qaaic=!c scalar paaic=!r endif next

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

Re: Error : For statement unterminated

Postby EViews Gareth » Sat Dec 12, 2015 4:19 pm

The error message is pretty darn accurate - you have a FOR statement without a NEXT statement. The last FOR statement isn't terminated with a NEXT.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests