BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

SQL + geodis()  -- sorry I have forgetton. You need check documentation. Here is dummy code.

proc sql;

create table distance as

select a.* ,b.id as _id, geodis(.......)  as distance

  from have a, have b;

quit;

after that you need transpose your table distance to get final output.

Xia Keshan

View solution in original post

3 REPLIES 3
Ksharp
Super User

SQL + geodis()  -- sorry I have forgetton. You need check documentation. Here is dummy code.

proc sql;

create table distance as

select a.* ,b.id as _id, geodis(.......)  as distance

  from have a, have b;

quit;

after that you need transpose your table distance to get final output.

Xia Keshan

ballardw
Super User

Syntaxt for

GEODIST(latitude-1, longitude-1, latitude-2, longitude-2 <,options>)

so use Ksharps code and bring in the b version of lat and long :

add to the select statement

b.longitude as blong, b.latitude as blat, geodist (latitude, longitude, blat, blong) as distance

you may likely want the store from the b data set as well so you know which distance which would bring up b.id as bstore in the select as well.

Yondori
Calcite | Level 5

Thanks to all. I finally found 'how to'.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1793 views
  • 3 likes
  • 3 in conversation