For a given pair of states, your problem can be formulated as a linear assignment problem, where the cost of assigning record i from one state to record j from the other state is the absolute difference of the property values. See the following usage note for how to solve a linear assignment problem using the LP solver in SAS/OR: http://support.sas.com/kb/35/026.html In SAS/OR 12.1, which will be released next month, there is also a linear assignment problem algorithm available in the new OPTNET procedure. Note that without your threshold constraint, if there are n records for each of the two states, then just sorting the values for each state and matching them up in that order is optimal. This property does not hold in general, but for your absolute difference cost, it is easy to show that any other matching will have higher cost. (If two values are out of order, interchanging them will improve the cost.)
... View more