Illegal name or reserved name

For questions regarding programming in the EViews programming language.

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

Envirogate
Posts: 12
Joined: Mon Apr 04, 2011 9:18 am

Illegal name or reserved name

Postby Envirogate » Wed Aug 15, 2012 11:42 am

Hay,

I am trying to learn programming in eveiws. In doing a CGE modeling excercise, I came across the "illegal name or reserved name" error when I wanted to assign values. Here is the command:
FOR %VR BOT EXR PD PE PM PQ PWE PWM PX QQ QM RPD RPX XD XE XS YH omega
sigma
SERIES %VR
NEXT
BOT=0
PD=1
PWE=1
PWM=1
XD=MSAM(1,2)

The error message says BOT is illegal name or reserved. I am using Eviews 7.

Thanks for your help

Regopark98
Posts: 1
Joined: Tue Sep 22, 2009 11:28 am

Re: Illegal name or reserved name

Postby Regopark98 » Wed Aug 15, 2012 12:37 pm

Change the line "SERIES %VR" to "SERIES {%VR}" will do.

Envirogate
Posts: 12
Joined: Mon Apr 04, 2011 9:18 am

Re: Illegal name or reserved name

Postby Envirogate » Wed Aug 15, 2012 12:48 pm

Thanks alot working very well now

Envirogate
Posts: 12
Joined: Mon Apr 04, 2011 9:18 am

Re: Illegal name or reserved name

Postby Envirogate » Fri Aug 17, 2012 9:09 am

A similar problem however in obtaining row sums in a matrix. The row total suppossed to be 100 while the command I am using is giving me a crazy number. Any help would be appreciated. Here is the command.

!NRWS=@ROWS(MSAM)
FOR !R=1 TO (!NRWS-1)
ROWVECTOR RV{!R}=@ROWEXTRACT(MSAM, !R)
VTOT(!R)=@SUM(RV{!R})
DELETE RV{!R}
NEXT

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

Re: Illegal name or reserved name

Postby EViews Gareth » Fri Aug 17, 2012 9:20 am

Seems to work for me:

Code: Select all

create u 10 matrix(10,3) msam rnd(msam) vector(10) vtot !NRWS=@ROWS(MSAM) FOR !R=1 TO (!NRWS-1) ROWVECTOR RV{!R}=@ROWEXTRACT(MSAM, !R) VTOT(!R)=@SUM(RV{!R}) DELETE RV{!R} NEXT

Envirogate
Posts: 12
Joined: Mon Apr 04, 2011 9:18 am

Re: Illegal name or reserved name

Postby Envirogate » Fri Aug 17, 2012 9:29 am

Thanks it also work for me but the problem is the row sum is not correct. What I get is 3900 while the sum is 100.

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

Re: Illegal name or reserved name

Postby EViews Gareth » Fri Aug 17, 2012 9:42 am

Works for me.

Envirogate
Posts: 12
Joined: Mon Apr 04, 2011 9:18 am

Re: Illegal name or reserved name

Postby Envirogate » Fri Aug 17, 2012 10:50 am

Thanks I opened a new program file and a copy paste made it possible. But for curisity when I run the program multiple times the row sum multiplies itself.

Thanks

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Illegal name or reserved name

Postby EViews Glenn » Fri Aug 17, 2012 11:05 am

Ignoring from the pedagogical value of the exercise, wouldn't the following be easier?

Code: Select all

vector vtot = @csum(@transpose(msam))
Not sure about the increasing value of VTOT on repeats. Doesn't seem to do it for me.

paiol
Posts: 1
Joined: Thu Sep 03, 2015 6:42 pm

Re: Illegal name or reserved name

Postby paiol » Thu Sep 03, 2015 6:54 pm

Change the line "SERIES %VR" to "SERIES {%VR}" will do.
I am using version 8, and Iam using the same model code. but its not workin for me.. any help on this?

thanks

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

Re: Illegal name or reserved name

Postby EViews Gareth » Thu Sep 03, 2015 8:00 pm

You need to change what you're doing wrong to be something that is right.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests