Thank you for the replies. I intend to get to grips with mata more and try to understand and replicate your thoughts and examples
For interest, I implemented a quick (but clumsy) fix this morning which simply restricts each vector by the 10km limit, counts the number of rows and inputs this into a variable Count. I then run a second loop which cuts down each vector to a dimension of x, where x=max(Count). When brought into Stata, it's then a case of setting all irrelevant aspects to missing.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/