<?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: Downloading files from WEB in SAS Users Group in Israel</title>
    <link>https://communities.sas.com/t5/SAS-Users-Group-in-Israel/Downloading-files-from-WEB/m-p/752835#M255</link>
    <description>&lt;P&gt;The problem here seems to be this:&lt;/P&gt;
&lt;P&gt;Instead of supplying the file, the website sends a script which then does the download. Since PROC HTTP is not a full-fledged web browser with a Javascript sandbox, this won't work.&lt;/P&gt;
&lt;P&gt;IMO, the non-standard way that the website handles downloads means that you can't automate this in SAS, but I may be proven otherwise.&lt;/P&gt;
&lt;P&gt;I suggest that you also open a track with SAS technical support while you wait for possible answers here.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jul 2021 11:11:58 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-07-08T11:11:58Z</dc:date>
    <item>
      <title>Downloading files from WEB</title>
      <link>https://communities.sas.com/t5/SAS-Users-Group-in-Israel/Downloading-files-from-WEB/m-p/752788#M252</link>
      <description>&lt;P&gt;hey guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i'm trying to automate a download process using SAS.&lt;/P&gt;
&lt;P&gt;i found some posts on this but non of them worked for me..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the code runs but i dont get the expected resault&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any help?&lt;/P&gt;
&lt;P&gt;method 1&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename out "%sysfunc(getoption(WORK))\DL_File.xlsx";
 
proc http
 url='https://data.gov.il/dataset/branches/resource/1c5bc716-8210-4ec7-85be-92e6271955c2/download/snifim_heboi.org.il.xlsx'
 method="get" out=out;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;method2&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename myinfile url "https://data.gov.il/dataset/branches/resource/1c5bc716-8210-4ec7-85be-92e6271955c2/download/snifim_heboi.org.il.xlsx";
filename out "%sysfunc(getoption(WORK))\DL_File.xlsx";

data _null_;
	n=-1;
	infile myinfile recfm=s nbyte=n length=len;
	file out recfm=n;

	input;
	put _infile_ $varying32767. len;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jul 2021 08:06:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Users-Group-in-Israel/Downloading-files-from-WEB/m-p/752788#M252</guid>
      <dc:creator>Assaf_Attas</dc:creator>
      <dc:date>2021-07-08T08:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading files from WEB</title>
      <link>https://communities.sas.com/t5/SAS-Users-Group-in-Israel/Downloading-files-from-WEB/m-p/752817#M253</link>
      <description>&lt;P&gt;Run your first code with a different outfile name:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename out "/folders/myfolders/DL_File.html";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and you will find that you do not get a XLSX file, but a HTML file with lots of scripts in the header and no body.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 09:35:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Users-Group-in-Israel/Downloading-files-from-WEB/m-p/752817#M253</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-08T09:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading files from WEB</title>
      <link>https://communities.sas.com/t5/SAS-Users-Group-in-Israel/Downloading-files-from-WEB/m-p/752819#M254</link>
      <description>that's what i referred as the undesired result. &lt;BR /&gt;what i need is the actual file the link refers to.</description>
      <pubDate>Thu, 08 Jul 2021 09:39:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Users-Group-in-Israel/Downloading-files-from-WEB/m-p/752819#M254</guid>
      <dc:creator>Assaf_Attas</dc:creator>
      <dc:date>2021-07-08T09:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading files from WEB</title>
      <link>https://communities.sas.com/t5/SAS-Users-Group-in-Israel/Downloading-files-from-WEB/m-p/752835#M255</link>
      <description>&lt;P&gt;The problem here seems to be this:&lt;/P&gt;
&lt;P&gt;Instead of supplying the file, the website sends a script which then does the download. Since PROC HTTP is not a full-fledged web browser with a Javascript sandbox, this won't work.&lt;/P&gt;
&lt;P&gt;IMO, the non-standard way that the website handles downloads means that you can't automate this in SAS, but I may be proven otherwise.&lt;/P&gt;
&lt;P&gt;I suggest that you also open a track with SAS technical support while you wait for possible answers here.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 11:11:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Users-Group-in-Israel/Downloading-files-from-WEB/m-p/752835#M255</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-08T11:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading files from WEB</title>
      <link>https://communities.sas.com/t5/SAS-Users-Group-in-Israel/Downloading-files-from-WEB/m-p/752871#M256</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/330397"&gt;@Assaf_Attas&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tested your URL with a 3rd party tool called "curl" and I got back from the server a file that contains HTML with embedded JavaScript as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;suggested.&lt;/P&gt;
&lt;P&gt;So it seems like this is not a SAS specific problem with handling this URL as it seems like "curl" is not downloading the XLSX file as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Eyal&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 14:14:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Users-Group-in-Israel/Downloading-files-from-WEB/m-p/752871#M256</guid>
      <dc:creator>EyalGonen</dc:creator>
      <dc:date>2021-07-08T14:14:04Z</dc:date>
    </item>
  </channel>
</rss>

