Page 1 of 1

Control variables and program arguments (EV 6)

Posted: Sun Apr 25, 2010 9:26 am
by nadja123
Hi there,

I get error message when running the below code, although, strangely, two merged charts are created and aligned "outcome_rev_rev" and "outcome_rev_xpe". I thought, I can use string variables in a for loop, formed from program arguments. Maybe such an idea cannot work in general in EViews 6. Otherwise, it could be just some stupid mistake in my specification I am just overlooking.

The program arguments %1, %2, %3 are: gdp, rev, xpe

Many thanks for helping!!!


Code: Select all

open C:\Zeviewsdirectory\chartscholeski.wf1 for %x {%1}_{%1} {%1}_{%2} {%1}_{%3} {%2}_{%1} {%2}_{%2} {%2}_{%3} {%3}_{%1} {%3}_{%2} {%3}_{%3} graph outcome_{%x}.merge joint_{%x}_1 joint_{%x}_2 joint_{%x}_3 joint_{%x}_4 joint_{%x}_5 joint_{%x}_6 joint_{%x}_7 joint_{%x}_8 joint_{%x}_9 joint_{%x}_10 outcome_{%x}.align(6,1.5,1) next save C:\Zeviewsdirectory\chartscholeski.wf1 close chartscholeski

Re: Control variables and program arguments (EV 6)

Posted: Sun Apr 25, 2010 9:40 am
by EViews Gareth
Program arguments are 0 based, not 1 based.

i.e. the first argument should be referred to with %0, not %1. Thus, in your particular case, %1 = REV, %2 = XPE and %3 doesn't exist, which is why the program errors.

Re: Control variables and program arguments (EV 6)

Posted: Sun Apr 25, 2010 11:00 am
by nadja123
Dear QMS Gareth,

thanks for this fantastic help.

On my own, I would have hardly figured out that I strictly need to start with %0. So far I remember in the helpfile, the examples start with a %0, but there was no explicit alert that it must be so. From the for loop examples I know that one can start with %1 if there are multiple controls. My motivation to use %1, %2 and %3 in this case is enforced by easy readability of the impulse response ordering. Therefore I just added a fake zero argument to the code, indicating the number of columns in the merged chart. This way I can keep %1, %2 and %3 as they are.

Many thanks and my respect for a quick response on Sunday.