%macro geodist(lat1,long1,lat2,long2); %*--This macro was taken from a SAS global forum paper: http://support.sas.com/resources/papers/proceedings09/215-2009.pdf . Just to check to see if it agrees with the algorithm we have been using for years. jgb, 5-09 ---; %let pi180=0.0174532925199433; 7921.6623*arsin(sqrt((sin((&pi180*&lat2-&pi180*&lat1)/2))**2+ cos(&pi180*&lat1)*cos(&pi180*&lat2)*(sin((&pi180*&long2- &pi180*&long1)/2))**2)); %mend;