<?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: REST API PROC HTTP  failing for dynamic IP address in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/REST-API-PROC-HTTP-failing-for-dynamic-IP-address/m-p/665843#M199139</link>
    <description>&lt;P&gt;Thank you for your alternate solution of using the filename URL as a better alternative.&amp;nbsp; I am not sure why our security team white lists IP addresses and not URLs.&amp;nbsp; Because we are a hospital system, we tend to be more conservative in our approach to Internet access.&amp;nbsp; Interestingly, both approaches worked when I tested your solution this morning.&amp;nbsp; When I refreshed the table to demonstrate the process is repeatable, both approaches failed to connect to the source.&amp;nbsp; I am going to operate under the assumption that this is not a SAS solvable problem and that I need to work with our security team and the website administrator to understand and resolve the issue.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jun 2020 16:33:55 GMT</pubDate>
    <dc:creator>Jim_Cooper_hmsa</dc:creator>
    <dc:date>2020-06-29T16:33:55Z</dc:date>
    <item>
      <title>REST API PROC HTTP  failing for dynamic IP address</title>
      <link>https://communities.sas.com/t5/SAS-Programming/REST-API-PROC-HTTP-failing-for-dynamic-IP-address/m-p/665487#M198990</link>
      <description>&lt;DIV class="sasSource"&gt;I am trying to automate the download and analysis of The Covid Tracking Project data that is made avalable on the Internet.&amp;nbsp; I was able to get the IP address white listed by our network security team and the program worked once.&amp;nbsp; What I discovered over the lat couple of weeks is that the Web site used multiple IP addresses and sometimes the code works, but most times it does not because it connects through a different IP address.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;Is there a SAS workaround or has someone run into this problem before?&amp;nbsp; I don't think that I can ask for a white list to dynamic list of IP addresses since I don;t know the complete list of addresses that might be used.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;Program Log.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;81 * Test Internet connection for downloading;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;82 %macro prochttp_check_return(code);&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;83 %if %symexist(SYS_PROCHTTP_STATUS_CODE) ne 1 %then %do;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;84 %put ERROR: Expected &amp;amp;code., but a response was not received from&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;85 the HTTP Procedure;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;86 %abort;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;87 %end;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;88 %else %do;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;89 %if &amp;amp;SYS_PROCHTTP_STATUS_CODE. ne &amp;amp;code. %then %do;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;90 %put ERROR: Expected &amp;amp;code., but received &amp;amp;SYS_PROCHTTP_STATUS_CODE.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;91 &amp;amp;SYS_PROCHTTP_STATUS_PHRASE.;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;92 %abort;%end;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;93 %end;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;94 %mend;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;95&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;96 proc http url="&lt;A href="https://covidtracking.com/api/v1/states/daily.csv" target="_blank"&gt;https://covidtracking.com/api/v1/states/daily.csv&lt;/A&gt;";&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;97 run;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogError1_1593223648730" class="sasError"&gt;ERROR: Error connecting to 104.248.78.24:443. (The connection has timed out.)&lt;/DIV&gt;
&lt;DIV id="sasLogError2_1593223648730" class="sasError"&gt;ERROR: Unable to establish connection to covidtracking.com.&lt;/DIV&gt;
&lt;DIV id="sasLogError3_1593223648730" class="sasError"&gt;ERROR: Unable to connect to Web server.&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;PRE id="pre_sasLog_3376" class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jun 2020 02:24:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/REST-API-PROC-HTTP-failing-for-dynamic-IP-address/m-p/665487#M198990</guid>
      <dc:creator>Jim_Cooper_hmsa</dc:creator>
      <dc:date>2020-06-27T02:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: REST API PROC HTTP  failing for dynamic IP address</title>
      <link>https://communities.sas.com/t5/SAS-Programming/REST-API-PROC-HTTP-failing-for-dynamic-IP-address/m-p/665497#M198994</link>
      <description>&lt;P&gt;It seems a bit strange to me that it is the IP address that gets white-listed, can't you ask them to white-list the URL?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another way to access the file could just be to use a filename, e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename covid url 'https://covidtracking.com/api/v1/states/daily.csv';

proc import datafile=covid out=test dbms=csv replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am not sure whether this will be any different, though.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jun 2020 06:41:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/REST-API-PROC-HTTP-failing-for-dynamic-IP-address/m-p/665497#M198994</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2020-06-27T06:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: REST API PROC HTTP  failing for dynamic IP address</title>
      <link>https://communities.sas.com/t5/SAS-Programming/REST-API-PROC-HTTP-failing-for-dynamic-IP-address/m-p/665843#M199139</link>
      <description>&lt;P&gt;Thank you for your alternate solution of using the filename URL as a better alternative.&amp;nbsp; I am not sure why our security team white lists IP addresses and not URLs.&amp;nbsp; Because we are a hospital system, we tend to be more conservative in our approach to Internet access.&amp;nbsp; Interestingly, both approaches worked when I tested your solution this morning.&amp;nbsp; When I refreshed the table to demonstrate the process is repeatable, both approaches failed to connect to the source.&amp;nbsp; I am going to operate under the assumption that this is not a SAS solvable problem and that I need to work with our security team and the website administrator to understand and resolve the issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 16:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/REST-API-PROC-HTTP-failing-for-dynamic-IP-address/m-p/665843#M199139</guid>
      <dc:creator>Jim_Cooper_hmsa</dc:creator>
      <dc:date>2020-06-29T16:33:55Z</dc:date>
    </item>
  </channel>
</rss>

