Page 1 of 1
Illegal name or reserved name
Posted: Wed Aug 15, 2012 11:42 am
by Envirogate
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
Re: Illegal name or reserved name
Posted: Wed Aug 15, 2012 12:37 pm
by Regopark98
Change the line "SERIES %VR" to "SERIES {%VR}" will do.
Re: Illegal name or reserved name
Posted: Wed Aug 15, 2012 12:48 pm
by Envirogate
Thanks alot working very well now
Re: Illegal name or reserved name
Posted: Fri Aug 17, 2012 9:09 am
by Envirogate
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
Re: Illegal name or reserved name
Posted: Fri Aug 17, 2012 9:20 am
by EViews Gareth
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
Re: Illegal name or reserved name
Posted: Fri Aug 17, 2012 9:29 am
by Envirogate
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.
Re: Illegal name or reserved name
Posted: Fri Aug 17, 2012 9:42 am
by EViews Gareth
Works for me.
Re: Illegal name or reserved name
Posted: Fri Aug 17, 2012 10:50 am
by Envirogate
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
Re: Illegal name or reserved name
Posted: Fri Aug 17, 2012 11:05 am
by EViews Glenn
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.
Re: Illegal name or reserved name
Posted: Thu Sep 03, 2015 6:54 pm
by paiol
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
Re: Illegal name or reserved name
Posted: Thu Sep 03, 2015 8:00 pm
by EViews Gareth
You need to change what you're doing wrong to be something that is right.