<?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: Connection reset by peer error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Connection-reset-by-peer-error/m-p/603853#M174985</link>
    <description>&lt;P&gt;Okay, but I'm not running this code any more frequently or with any more observations than I have in the past 3 years.&lt;/P&gt;
&lt;P&gt;I realize I may be outside of the SAS realm but are you familiar with how to get in touch with Google regarding this issue?&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2019 13:22:07 GMT</pubDate>
    <dc:creator>uabcms</dc:creator>
    <dc:date>2019-11-13T13:22:07Z</dc:date>
    <item>
      <title>Connection reset by peer error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connection-reset-by-peer-error/m-p/603623#M174897</link>
      <description>&lt;P&gt;Using code I aquired a few years ago from a paper by Mike Zdeb, which get drive distances and times with Google Maps.&lt;/P&gt;
&lt;P&gt;Have run it often since then.&lt;/P&gt;
&lt;P&gt;Recently am getting&amp;nbsp; a 'Connection reset by peer' error.&amp;nbsp; &amp;nbsp; Don't think it's a SAS issue per se so I'm wondering if anyone has any&lt;/P&gt;
&lt;P&gt;insight regarding who or how to contact at Google.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;___________________________________________________________________________________________________&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let z1=35294;&lt;BR /&gt;&lt;BR /&gt;* data set with zip codes (98765 is an invalid zip code);&lt;BR /&gt;data zip_info;&lt;BR /&gt;input zip @@;&lt;BR /&gt;datalines;&lt;BR /&gt;35244 35209 35007&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;* place number of zip in a macro variable;&lt;BR /&gt;data _null_;&lt;BR /&gt;call symputx('nzips',obs);&lt;BR /&gt;stop;&lt;BR /&gt;set zip_info nobs=obs;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;* delete any data set named DISTANCE_TIME that might exist in the WORK library;&lt;BR /&gt;proc datasets lib=work nolist;&lt;BR /&gt;delete distance_time;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;* create a macro that contains a loop to access Google Maps multiple time;&lt;BR /&gt;%macro distance_time;&lt;BR /&gt;%do j=1 %to &amp;amp;nzips;&lt;BR /&gt;data _null_;&lt;BR /&gt;nrec = &amp;amp;j;&lt;BR /&gt;set zip_info point=nrec;&lt;BR /&gt;call symputx('z2',put(zip,z5.));&lt;BR /&gt;stop;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;filename x url "&lt;A href="https://www.google.com/maps/dir/&amp;amp;z1/&amp;amp;z2/?force=lite" target="_blank"&gt;https://www.google.com/maps/dir/&amp;amp;z1/&amp;amp;z2/?force=lite&lt;/A&gt;";&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;filename z temp;&lt;BR /&gt;&lt;BR /&gt;* same technique used in the example with two zip codes;&lt;BR /&gt;data _null_; &lt;BR /&gt;infile x recfm=f lrecl=1 end=eof; &lt;BR /&gt;file z recfm=f lrecl=1;&lt;BR /&gt;input @1 x $char1.; &lt;BR /&gt;put @1 x $char1.;&lt;BR /&gt;if eof;&lt;BR /&gt;call symputx('filesize',_n_);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;* drive time as a numeric variable;&lt;BR /&gt;data temp;&lt;BR /&gt;retain zip &amp;amp;z2;&lt;BR /&gt;infile z recfm=f lrecl=&amp;amp;filesize. eof=done;&lt;BR /&gt;input @ 'miles' +(-15) @ '"' distance :comma12. text $30.;&lt;BR /&gt;units = scan(text,1,'"');&lt;BR /&gt;text = scan(text,3,'"');&lt;BR /&gt;&lt;BR /&gt;* convert times to seconds;&lt;BR /&gt;select;&lt;BR /&gt;* combine days and hours;&lt;BR /&gt;when (find(text,'d') ne 0) time = sum(86400*input(scan(text,1,' '),best.), &lt;BR /&gt;3600*input(scan(text,3,' '),best.));&lt;BR /&gt;* combine hours and minutes;&lt;BR /&gt;when (find(text,'h') ne 0) time = sum(3600*input(scan(text,1,' '),best.), &lt;BR /&gt;60*input(scan(text,3,' '),best.));&lt;BR /&gt;* just minutes;&lt;BR /&gt;otherwise time = 60*input(scan(text,1,' '),best.);&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;output; &lt;BR /&gt;keep zip distance units time;&lt;BR /&gt;stop;&lt;BR /&gt;done:&lt;BR /&gt;output;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;filename x clear;&lt;BR /&gt;filename z clear;&lt;BR /&gt;&lt;BR /&gt;* add an observation to the data set DISTANCE_TIME;&lt;BR /&gt;proc append base=distance_time data=temp;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;* use the macro;&lt;BR /&gt;%distance_time;&lt;BR /&gt;&lt;BR /&gt;* add the straight line distance to the data set;&lt;BR /&gt;data distance_time;&lt;BR /&gt;set distance_time;&lt;BR /&gt;zip_city = zipcitydistance(12203,zip);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data=distance_time;&lt;BR /&gt;format zip z5. distance comma6. time time6.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 16:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connection-reset-by-peer-error/m-p/603623#M174897</guid>
      <dc:creator>uabcms</dc:creator>
      <dc:date>2019-11-12T16:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Connection reset by peer error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connection-reset-by-peer-error/m-p/603741#M174939</link>
      <description>&lt;P&gt;Google will refuse the connection if the same IP address queries its services too many times or without sufficient delay between the queries.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 03:02:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connection-reset-by-peer-error/m-p/603741#M174939</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-11-13T03:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Connection reset by peer error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connection-reset-by-peer-error/m-p/603853#M174985</link>
      <description>&lt;P&gt;Okay, but I'm not running this code any more frequently or with any more observations than I have in the past 3 years.&lt;/P&gt;
&lt;P&gt;I realize I may be outside of the SAS realm but are you familiar with how to get in touch with Google regarding this issue?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 13:22:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connection-reset-by-peer-error/m-p/603853#M174985</guid>
      <dc:creator>uabcms</dc:creator>
      <dc:date>2019-11-13T13:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Connection reset by peer error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connection-reset-by-peer-error/m-p/604019#M175060</link>
      <description>&lt;P&gt;Google may change its terms of service at any time. Especially for a free service. It might be different if you paid.&lt;/P&gt;
&lt;P&gt;Unsure about how to contact them about his, sorry.&lt;/P&gt;
&lt;P&gt;An option if you want to space the calls is to use &lt;FONT face="courier new,courier"&gt;call sleep().&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 05:46:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connection-reset-by-peer-error/m-p/604019#M175060</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-11-14T05:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Connection reset by peer error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connection-reset-by-peer-error/m-p/604089#M175087</link>
      <description>&lt;P&gt;Appreciate your input&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 13:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connection-reset-by-peer-error/m-p/604089#M175087</guid>
      <dc:creator>uabcms</dc:creator>
      <dc:date>2019-11-14T13:16:02Z</dc:date>
    </item>
  </channel>
</rss>

