sele 1
use sdarti index sdarti alias ar
sele 2
use c:\dbxl\afjp\res\reserv
index on codearti to tmpres
do while .not. eof()
prod=codart
reser=0
do while .t.
find &prod
if codearti=prod
reser=reser+q2
skip
loop
else
exit
endi
enddo
replace ar->res with reser
close data
retu