select distinct empno from myTable into array arrEmps lnEmps = _Tally if lnEmps <= 255 && Field limit local array arrStruc[lnEmps,4] arrStruc = 0 for ix=1 to lnEmps arrStruc[ix,1] = 'F'+padl(ix,3,'0') arrStruc[ix,2] = 'I' arrStruc[ix,3] = 4 endfor create cursor myEmps from array arrStruc dimension arrEmps[1,lnEmps] append from array arrEmps brow endifCetin