Old school programmer but new to SAS. I've got two tables of portfolio data with multiple columns. Table B has many more rows than Table A. I'm trying to match ALL the rows in Table A with the closest matching row in Table B based on the closest matching Long_Cap to Short_Cap AND Long_Beta to Short_Beta. Doing a close match on ONE column is trivial, but two columns has me stumped. I have a feeling that PROC MODECLUS may be the solution, treating the Caps and Betas as pairs and then matching each up with it's nearest neighbor. So, basically, match ALL the blue dots in the chart below with the closest orange dot, using an orange dot only once. Any help would be appreciated. TABLE A Long_Ticker Long_Cap Long_Beta ACCO 1299.922492 2.424713513 ARCB 916.517387 2.385758789 AVP 945.995035 -3.556207808 BKE 1159.9804 4.534069004 CAL 1438.941506 1.885933611 CBB 879.567966 -3.080362524 CLNE 306.703682 -1.03556073 DNR 888.640745 4.21629385 ECHO 781.413416 -0.075975634 ELY 1316.89162 -3.776411519 ... ... ... TABLE B Short_Ticker Short_Cap Short_Beta ABEO 741.387823 -1.774667292 ADMS 771.976243 6.600176051 ADTN 931.694585 1.452481453 AFI 435.270485 4.9820341 AMAG 468.710018 -1.700958032 AMPH 884.573353 1.227854433 AROW 472.594912 1.35509369 ATSG 1368.062531 2.215485056 BATRA 1097.594852 0.577381117 BLX 1058.906717 1.013467181 BSRR 404.209734 3.787348746 BSTC 311.509465 0.393381415 CALX 299.848804 4.23718815 CASH 895.597704 0.024619045 CATO 398.507035 5.609581484 CDZI 324.929355 2.381925261 ... ... ...
... View more