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
Illegal name or reserved name
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
Regopark98
- Posts: 1
- Joined: Tue Sep 22, 2009 11:28 am
Re: Illegal name or reserved name
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
Thanks alot working very well now
-
Envirogate
- Posts: 12
- Joined: Mon Apr 04, 2011 9:18 am
Re: Illegal name or reserved name
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
!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
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
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
Works for me.
-
Envirogate
- Posts: 12
- Joined: Mon Apr 04, 2011 9:18 am
Re: Illegal name or reserved name
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
Thanks
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Illegal name or reserved name
Ignoring from the pedagogical value of the exercise, wouldn't the following be easier?
Not sure about the increasing value of VTOT on repeats. Doesn't seem to do it for me.
Code: Select all
vector vtot = @csum(@transpose(msam))
Re: Illegal name or reserved name
I am using version 8, and Iam using the same model code. but its not workin for me.. any help on this?Change the line "SERIES %VR" to "SERIES {%VR}" will do.
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
You need to change what you're doing wrong to be something that is right.
Who is online
Users browsing this forum: No registered users and 2 guests
