iterating on elements of series - date in while loop
Posted: Wed Mar 11, 2015 2:28 am
Hi everybody,
Here is my issue :
I have two series and I need to check whether some elements of the first series are equal to "na" and if it's not the case, copy paste these elems in the second series.
Currently, my code is as follows :
I'd like to know if there is any way to make it easier and faster since I need to repete this kind of things for a lot of series.
Thanks a lot !
Loulouviews
Here is my issue :
I have two series and I need to check whether some elements of the first series are equal to "na" and if it's not the case, copy paste these elems in the second series.
Currently, my code is as follows :
Code: Select all
smpl %debprev %debsemep-1
%date=%debprev
while @dtoo(%date) < @dtoo(%debsemep)
for %i a1 a2 a3 a4
if @elem({%i}_ct(),%date) <> na then
@elem(gm_{%i}f,%date)=@elem({%i}_ct,%date)
endif
next
%date=@otod(@dtoo(%date)+1)
wend
Thanks a lot !
Loulouviews