I have encountered the following issue using geodist from SSC, by Robert Picard:
When all coordinates are missing, geodist creates an error, which is either not directly informative, or should not be reported at all.
This is a simple example:
Code:
clear
set obs 1
gen lat1 = .
gen lon1 = .
gen lat2 = .
gen lon2 = .

geodist lat1 lon1 lat2 lon2, gen(dist1)
Produces:

Code:
latitude 1 must be between -90 and 90
Being more explicit by using an if-qualifier as specified in the next line also does not help.

Code:
geodist lat1 lon1 lat2 lon2 if !missing(lat1, lon1, lat2, lon2), gen(dist2)
Is this behaviour intended? I would not expect any error message to occur, especially as the following works just fine:

Code:
clear
set obs 2
gen lat1 = 0 in 1
gen lon1 = 0 in 1
gen lat2 = 10 in 1
gen lon2 = 20 in 1

geodist lat1 lon1 lat2 lon2, gen(dist)