t_percent = .05 && Percent of file to extract t_type1 = 0 && number of filename.fieldname = 1 t_recs_03 = 0 && counter for recordss held t_cnttype = 0 && filename.fieldname = 1 counter t_pct_cnt = 0 && recs to skip between extractions USE filename in 0 ALIAS input EXCLUSIVE t_pct_nbr = CEILING(t_type1 * t_percent) && Whole number of recs to extract t_pct_cnt = CEILING(t_type1 / t_pct_nbr) && Number of recs to skip SCAN SCATTER MEMVAR *)****************************************************************************** *) If the record doesn't have a fieldname = 1 AND MOD of t_type1 isn't a 0 *) stick the record into both files; *) If the record is a mailtype =1 and Mod of the t_type1 is 0 *) make sshop = to "Hold" and stick the record only into the pctfile file, *) and add 1 to t_type1 for next go around *)------------------------------------------------------------------------------ DO CASE CASE m.fieldname = 1 t_cnttype = t_cnttype + 1 IF MOD(t_cnttype, t_pct_cnt) = 0 m.fieldname2 = "Hold" INSERT INTO pctfile FROM MEMVAR t_recs_03 = t_recs_03 + 1 ELSE INSERT INTO input FROM MEMVAR INSERT INTO pctfile FROM MEMVAR ENDIF OTHERWISE INSERT INTO input FROM MEMVAR ENDCASE ENDSCANIt's written for FPW2.6, so please excuse the bad varnames