BEST(<sort-list>) – new option for DEDUP
The BEST option provides additional control over which records are retained from a set of “duplicate” records. The first in the <sort-list> order of records are retained. The sort-list is comma delimited list of fields. The fields may be prefixed with a minus sign to require a reverse sort on that field.
DEDUP(recordset, field1, BEST(field2) ) means that from set of duplicate records, the first record from the set duplicates sorted by field2 is retained. DEDUP(recordset, field1, BEST(-field2) ) produces the last record sorted by field2 from the set of duplicates.
BEST option cannot currently be used with a KEEP parameter greater than ‘1’.