In reply to Qui Phan.

You are welcome to try. The SAS DATA step supports 2-D arrays. However, in general, the SAS/IML matrix language is superior for handling customized analyses that analyze both rows and columns. The DATA step doesn't have the DISTANCE function, but the 2-D L1 distance is trivial to compute.