Page 1 of 1

@wlookup with loop variable

Posted: Thu Nov 29, 2012 3:45 pm
by mtimmes
Hello - sorry if this a very basic question...

I'm trying to nest two for loops, where the inner loop selects a group of variables based on the value of the outer loop (in this case, country on the outer, product on the inner).
Unfortunately, I can't seem to make the line %prod = @wlookup(@wunion("in*",{%z})) work.
Any suggestions or advice appreciated, thanks.
----------------------------------------------------
%cntry = "be de uk"
for %z {%cntry}
%prod = @wlookup(@wunion("in*",{%z}))
for %y {%prod}
equation eq_{%y}.stepls {%y} econs
eq_{%y}.forecast {%y}_ls
next
next
-------------------------------------------------

Re: @wlookup with loop variable

Posted: Thu Nov 29, 2012 5:30 pm
by EViews Gareth
Can't you just use:

Code: Select all

%cntry = "be de uk" for %z {%cntry} %prod = @wlookup("in*"+%z) for %y {%prod} equation eq_{%y}.stepls {%y} econs eq_{%y}.forecast {%y}_ls next next

Re: @wlookup with loop variable

Posted: Fri Nov 30, 2012 12:37 am
by mtimmes
Perfect, thank you for the help and the quick response.

Re: @wlookup with loop variable

Posted: Tue Jan 13, 2015 2:57 am
by Ale_lanza
for !%y = bah kuw oma qat sau uni
for !%x = _co2 _pop _gdp _tpes _tfc

genr l%y%x= log(%y%x)

next
next


a very basic question....but It does not work...

Thanks

Re: @wlookup with loop variable

Posted: Tue Jan 13, 2015 9:08 am
by EViews Gareth

Code: Select all

for %y bah kuw oma qat sau uni for %x _co2 _pop _gdp _tpes _tfc genr l{%y}{%x}= log({%y}{%x}) next next