I've tested the following. It works well with DB 3+, hopefully you won't have to modify too much. Make sure that you change the wording in [red]RED[/red] to the database you wish to modify. (note that this program will be processing a working copy...that way if there are any situations that you'll require the original data, it'll still be there.) Just to be on the safe side, make a secondary copy of the original data.
*------Start copying here------
*
* Created with assistance of MiggyD from
*
Tek-Tips . com
*
set echo off
set talk off
set step off
clear
use
[red]ORIGINAL.DBF[/red]
if file("CLEANUP.DBF"

THEN
delete file CLEANUP.DBF
endif
YN = "N"
? "******************************************************"
? "* This program is designed to delete records. Where *"
? "* shipments to one (1) particulare city is less than *"
? "* 100. (EX: Seattle = 100 -- not deleted) *"
? "* (EX: Dallas = 99 -- deleted) *"
? "* (EX: Tusan = 200 -- not deleted) *"
? "******************************************************"
sort to CLEANUP.DBF on City
?
? "A copy of the original database will be used incase there"
? "are any problems with the program. The copied database"
? "name is CLEANUP.DBF"
?
? "When you are satisfied with the results, please rename"
? "the original DBF file for backup purposes -AND- rename"
? "the CLEANUP.DBF file as the original one so that it can"
? "be used for processing. OR, you can delete the original"
? "but you'll still need to rename the CLEANUP.DBF file."
?
? "To terminate now, press ESC key then the 'C' key."
? "Otherwise, you can just..."
Wait to YN
clear
use CLEANUP.DBF
MYCOUNT=0
MYRECNO=RecNo()
do while .not. eof()
if eof() then
exit do
endif
CHKCITY=upper(City)
count for upper(City)=CHKCITY to MYCOUNT
if MYCOUNT<100 then
? MYCOUNT
?? " matches for " + CHKCITY
delete all for upper(City) = CHKCITY
endif
MYRECNO=MYRECNO + MYCOUNT
if MYRECNO>RecCo() then
exit do
endif
goto MYRECNO
loop
enddo
pack
close all
?
? ".....Program done...."
return
*------END copying here------
Please let me know if works or not,
OR If you should have any problems.
--MiggyD It's better to have two heads to solve a problem from different angles than to have tunnel vision to a dead end.