Thanks for your reply, David!
We use a SEEK, followed by a DO WHILE loop. Here's a psuedo-code description:
SET ORDER TO nGroup
DO WHILE nGroup = 0
liRecno = RECNO()
lcField1 = cField1
SET ORDER TO cField1
SEEK lcField1
DO WHILE cField1 = lcField1
IF (RECNO() <> liRecno) .AND. (nGroup > 0)
*- This is a matching record, other than the one we're using..
lnGroup = nGroup && Get the group ID from this one...
GO liRecno
REPLACE nGroup WITH lnGroup
EXIT
ENDIF
ENDDO
IF nGroup = 0
*- No match, just create a new group ID here...
ENDIF
SET ORDER TO nGroup
GO TOP && Go to the next un-matched record...
ENDDO
It basically assigns the current record to a record that matches on one field. There are actually 3 fields used to match by, I left them out for clarity.
Thanks again!
Mark
>This is typically an indication that you do not have all the correct indexes for full Rushmore optimization. You can use SYS(3054) to check this. What are you using to do the processing SQL-SELECT? Scan loops? SET RELATION?
"It hit an iceberg and it sank. Get over it."
Robert Ballard, dicoverer of the Titanic wreckage.