In reply to Dara.

Most likely you are running an older version of SAS. The DISTANCE function was enhanced in SAS/IML 14.3 (with SAS 9.4M5) supports an optional argument to compute distances between observations in two different sets. For earlier versions of SAS, you can use the PairwiseDist function that I wrote.