Thank you Allin,

This is exactly what I was looking for (the corrected example).

On 3 February 2011 00:03, Allin Cottrell <cottrell@wfu.edu> wrote:
On Wed, 2 Feb 2011, Allin Cottrell wrote:

> loop j=1973..2006
>   smpl $j:1 $j:12+1
>   list OKstocks = null
>   loop foreach i r_AEX_INDE..r_ZEELAND_
>     n = sum(ok($i))
>     if n == 13
>        OKstocks = OKstocks $i
>     endif
>     if nelem(OKstocks) > 0
>       store "/Documents/data/stocks_valid_$j.gdt" OKstocks
>     endif
>   endloop
> endloop

Sorry, I messed that up, it should be

loop j=1973..2006
 smpl $j:1 $j:12+1
 list OKstocks = null
 loop foreach i r_AEX_INDE..r_ZEELAND_
   n = sum(ok($i))
   if n == 13
      OKstocks = OKstocks $i
   endif
 endloop
 if nelem(OKstocks) > 0
   store "/Documents/data/stocks_valid_$j.gdt" OKstocks
 endif
endloop

Allin Cottrell
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users



--
---------------------------------------
Sergey