Creating loops with different variables
Posted: Fri Jan 27, 2012 4:24 am
Hi,
I'm trying to create a program that works out a simple quarter on quarter change on a number of variables however I can't get the loop function to work fo some reason.
Here's the code:
for %v NEVI NEVJ NEVK NEVL
smpl 1990:01 2010:04
delete p%v
genr p%v = 100*(%v/%v(-1))-1)
next
I've only included a couple of variables here to demonstrate but it keeps coming back with an error message so I'm assuming I've made a mistake in the coding (or more than one mistake! :/)
Thanks in advance
I'm trying to create a program that works out a simple quarter on quarter change on a number of variables however I can't get the loop function to work fo some reason.
Here's the code:
for %v NEVI NEVJ NEVK NEVL
smpl 1990:01 2010:04
delete p%v
genr p%v = 100*(%v/%v(-1))-1)
next
I've only included a couple of variables here to demonstrate but it keeps coming back with an error message so I'm assuming I've made a mistake in the coding (or more than one mistake! :/)
Thanks in advance