<?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: Download xml files from multipe urls in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802739#M316053</link>
    <description>&lt;P&gt;Please post the complete (code and messages) log of the failing step into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Mar 2022 06:37:47 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-03-18T06:37:47Z</dc:date>
    <item>
      <title>Download xml files from multipe urls</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802720#M316039</link>
      <description>&lt;P&gt;I have list of urls of xmls that I need to download. I've the urls in csv (but can covert to any). I'm wondering there's a better way to download all xmls at once from all urls than doing it one by one. I'm currently using the following program to download one by one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=""&gt;&lt;SPAN&gt;filename&lt;/SPAN&gt; out &lt;SPAN&gt;"c:\temp\want.xml"&lt;/SPAN&gt;;
&amp;nbsp;
&lt;SPAN&gt;proc http&lt;/SPAN&gt;
 url=&lt;SPAN&gt;'https://s3.amazonaws.com/irs-form-990/201723199349204207_public.xml'&lt;/SPAN&gt;
 method=&lt;SPAN&gt;"get"&lt;/SPAN&gt; out=out;
&lt;SPAN&gt;run&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 23:29:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802720#M316039</guid>
      <dc:creator>92568466</dc:creator>
      <dc:date>2022-03-17T23:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Download xml files from multipe urls</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802724#M316043</link>
      <description>&lt;P&gt;Make a SAS dataset that has two character variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;URL for the location you want pull from&lt;/P&gt;
&lt;P&gt;FILE for the name where you want to save the result.&lt;/P&gt;
&lt;P&gt;Then just use a data step to generate a PROC HTTP statement for each observation:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename code temp;
data _null_;
  set LIST ;
  file code;
  put  'proc http method="get"'
     /  ' url='  url :$quote.
     /  ' out=' file :$quote.
     / ';run;'
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And you can use %INCLUDE to run them.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%include code / source2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Mar 2022 01:38:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802724#M316043</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-18T01:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Download xml files from multipe urls</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802738#M316052</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm not sure what you meant by 'file'. I created a variable named file with the possible names. I tried to run your code, but it didn't work. I got the following error:&lt;/P&gt;&lt;P&gt;"ERROR 22-322: Expecting a name.&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you advice on this? I've uploaded data here.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 05:30:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802738#M316052</guid>
      <dc:creator>92568466</dc:creator>
      <dc:date>2022-03-18T05:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Download xml files from multipe urls</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802739#M316053</link>
      <description>&lt;P&gt;Please post the complete (code and messages) log of the failing step into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 06:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802739#M316053</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-18T06:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Download xml files from multipe urls</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802748#M316060</link>
      <description>&lt;P&gt;I'm using the following code, as posted by Tom:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename code temp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;set test1;&lt;BR /&gt;file code;&lt;BR /&gt;put 'proc http method="get"'&lt;BR /&gt;/ ' url=' url :$quote.&lt;BR /&gt;/ ' out=' file :$quote.&lt;BR /&gt;/ ';run;'&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%include code / source2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached are datasets and the log file that shows the error. My objective is to get xmls from the urls (stored in the data set 'test1') and download all to a local folder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-03-18 02.59.38.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69547iE0904F782BAE3CA1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2022-03-18 02.59.38.png" alt="Screenshot 2022-03-18 02.59.38.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 07:13:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802748#M316060</guid>
      <dc:creator>92568466</dc:creator>
      <dc:date>2022-03-18T07:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Download xml files from multipe urls</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802749#M316061</link>
      <description>&lt;P&gt;You need to also include the FILENAME in the created code, as the OUT= option accepts only file references, not filenames.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename code temp;
data _null_;
  set LIST ;
  file code;
  put  '
    filename out ' file :$quote. ';'
    / 'proc http method="get"'
     /  ' url='  url :$quote.
     /  ' out=out'
     / ';run;'
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Mar 2022 07:24:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/802749#M316061</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-18T07:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Download xml files from multipe urls</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/803615#M316445</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;, appreciate your help. The code works great. I'm however running into a related problem that I've posted in as another question. I'm wondering if you can look into that as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Download-correct-xml/m-p/803612" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Download-correct-xml/m-p/803612&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 17:43:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Download-xml-files-from-multipe-urls/m-p/803615#M316445</guid>
      <dc:creator>92568466</dc:creator>
      <dc:date>2022-03-23T17:43:25Z</dc:date>
    </item>
  </channel>
</rss>

