<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Geodist and insufficient memory in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Geodist-and-insufficient-memory/m-p/507766#M136318</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data distance; 

set store_long_lat;

distance = geodist(Latitude, Longitude, latitude1, longitude1);

run;

proc print data=distance (obs=5);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you use SET it's unlikely you'll have an INPUT/INFIILE statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/242533"&gt;@craigwe85&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello, i currently have a table set up as which is called "store_long_lat"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24411i4338D4DADE23BEEB/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I would like to calculate the distance between Latitude Longitude, and Latitude1 Longitude1.&amp;nbsp; and call it distance within the same table. There are 2000 rows in this table so I wold like to stray from the method where you have to input your Long and Lat values . I tried the below code and it produces a table with no data. Feel like am I close but just cant get an output to produce.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data distance; set store_long_lat;&lt;BR /&gt;input Latitude Longitude latitude1 longitude1;&lt;BR /&gt;distance = geodist(Latitude, Longitude, latitude1, longitude1);&lt;BR /&gt;put 'distance = ' Distance 'Miles'; datalines;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran the below which produces a distance value inthe log but this does not work for my scenario:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;distance = geodist(44.746052,-65.516649,43.68,-79.63);&lt;BR /&gt;put 'Distance= ' distance 'kilometers'; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Oct 2018 14:53:41 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-10-26T14:53:41Z</dc:date>
    <item>
      <title>Geodist and insufficient memory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Geodist-and-insufficient-memory/m-p/507751#M136315</link>
      <description>&lt;P&gt;Hello, i currently have a table set up as which is called "store_long_lat"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24411i4338D4DADE23BEEB/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I would like to calculate the distance between Latitude Longitude, and Latitude1 Longitude1.&amp;nbsp; and call it distance within the same table. There are 2000 rows in this table so I wold like to stray from the method where you have to input your Long and Lat values . I tried the below code and it produces a table with no data. Feel like am I close but just cant get an output to produce.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data distance; set store_long_lat;&lt;BR /&gt;input Latitude Longitude latitude1 longitude1;&lt;BR /&gt;distance = geodist(Latitude, Longitude, latitude1, longitude1);&lt;BR /&gt;put 'distance = ' Distance 'Miles'; datalines;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran the below which produces a distance value inthe log but this does not work for my scenario:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;distance = geodist(44.746052,-65.516649,43.68,-79.63);&lt;BR /&gt;put 'Distance= ' distance 'kilometers'; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 14:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Geodist-and-insufficient-memory/m-p/507751#M136315</guid>
      <dc:creator>craigwe85</dc:creator>
      <dc:date>2018-10-26T14:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Geodist and insufficient memory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Geodist-and-insufficient-memory/m-p/507757#M136316</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/242533"&gt;@craigwe85&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just delete the INPUT and DATALINES statements. These are not required and in fact wrong because you read all data from a SAS dataset by means of a SET statement. Further, for a distance in miles you need to specify 'M' (case insensitive) as the fifth argument of the GEODIST function. Not sure how "insufficient memory" could be a problem here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: The PUT statement would write 2000 lines to the SAS log. Do you really want that?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 14:32:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Geodist-and-insufficient-memory/m-p/507757#M136316</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-26T14:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Geodist and insufficient memory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Geodist-and-insufficient-memory/m-p/507766#M136318</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data distance; 

set store_long_lat;

distance = geodist(Latitude, Longitude, latitude1, longitude1);

run;

proc print data=distance (obs=5);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you use SET it's unlikely you'll have an INPUT/INFIILE statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/242533"&gt;@craigwe85&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello, i currently have a table set up as which is called "store_long_lat"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24411i4338D4DADE23BEEB/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I would like to calculate the distance between Latitude Longitude, and Latitude1 Longitude1.&amp;nbsp; and call it distance within the same table. There are 2000 rows in this table so I wold like to stray from the method where you have to input your Long and Lat values . I tried the below code and it produces a table with no data. Feel like am I close but just cant get an output to produce.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data distance; set store_long_lat;&lt;BR /&gt;input Latitude Longitude latitude1 longitude1;&lt;BR /&gt;distance = geodist(Latitude, Longitude, latitude1, longitude1);&lt;BR /&gt;put 'distance = ' Distance 'Miles'; datalines;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran the below which produces a distance value inthe log but this does not work for my scenario:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;distance = geodist(44.746052,-65.516649,43.68,-79.63);&lt;BR /&gt;put 'Distance= ' distance 'kilometers'; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 14:53:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Geodist-and-insufficient-memory/m-p/507766#M136318</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-26T14:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Geodist and insufficient memory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Geodist-and-insufficient-memory/m-p/507768#M136319</link>
      <description>&lt;P&gt;Perfect thanks.. works great. Fairly new to SAS and was just taking bits and pieces to other things I have found.. insufficient Memory was not the error.. Must have clicked on wrong subject when it popped up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyhow.. thanks a lot for your help&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 14:55:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Geodist-and-insufficient-memory/m-p/507768#M136319</guid>
      <dc:creator>craigwe85</dc:creator>
      <dc:date>2018-10-26T14:55:04Z</dc:date>
    </item>
  </channel>
</rss>

