Page 1 of 1

loop for string variables

Posted: Thu Mar 14, 2019 10:04 pm
by SP123
Hi there,

I want to repeat the same calculation for numerous string variables. For example act/act_rb, nsw/nsw_rb etc. Below is the code I have written.

%seriesname = @wlookup ("*", "series")
for %n {%seriesname}
next
For %N act nsw qld vic %Y act_rb nsw_rb qld_rb vic_rb
series stack = {%N}/{%Y}
next

When I run the program it comes up with a syntax error. Can you please help ?

Re: loop for string variables

Posted: Fri Mar 15, 2019 7:46 am
by EViews Gareth

Code: Select all

For %N %y act act_rb nsw  nsw_rb qld  qld_rb vic  vic_rb
series stack = {%N}/{%Y}
next

Re: loop for string variables

Posted: Sun Mar 17, 2019 7:53 pm
by SP123
Thanks you for that. Is it possible for me to save each of the calculation in separate series or in one group ? thanks in advance again.

Re: loop for string variables

Posted: Sun Mar 17, 2019 7:55 pm
by EViews Gareth
Then give each series a different name.