title: k nearest neighbor in SAS: how to get the neighbor list for each row?
body: <p>currently I'm using the proc discrim in SAS to run a kNN analysis for a data set, but the problem may require me to get the top k neighbor list for each rows in my table, so how can I get this list from SAS??</p>
  
  <p>thanks for the answer, but I'm looking for the neighbor list for each data point, for example if i got data set:
  name age zipcode alcohol 
  John  26  08439   yes
  Cathy 49  47789   no
  smith 37  90897   no
  Tom   34  88642   yes</p>
  
  <p>then i need list:</p>
  
  <p>name neighbor1 neighbor2
  John  Tom       cathy
  Cathy Tom       Smith
  Smith Cathy     Tom
  Tom   John      Cathy</p>
  
  <p>I could not find this output from SAS, is there any whay that I can program to get this list? Thank you!</p>