<?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 XML LIBNAME reading data from URL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/XML-LIBNAME-reading-data-from-URL/m-p/477071#M122810</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i am attempting to read data in XML format from URL:&lt;/P&gt;&lt;P&gt;&lt;A href="https://danepubliczne.imgw.pl/api/data/synop/format/xml" target="_self"&gt;https://danepubliczne.imgw.pl/api/data/synop/format/xml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I can't method presented below to work.&lt;/P&gt;&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=engxml&amp;amp;docsetTarget=n1d4p29qcfovrxn1k4nalh0bz4n6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=pl" target="_self"&gt;http://documentation.sas.com/?docsetId=engxml&amp;amp;docsetTarget=n1d4p29qcfovrxn1k4nalh0bz4n6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=pl&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename imgw url 'https://danepubliczne.imgw.pl/api/data/synop/format/xml';
filename map 'C:\imgw_map.map';
libname imgw xmlv2 xmlmap=map access=readonly;
data xml;&lt;BR /&gt;set imgw.item;&lt;BR /&gt;run;&lt;BR /&gt;proc contents data=xml;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;imgw_map was created in SAS XML Mapper using 'AutoMap using XML' on a download data file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code doesn't return any errors, imgw library is created with 2 files, but unfortunately those sets are empty (no observations).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Surprisingly using nearly identical code, but for downloaded data gives correct results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename imgw 'C:\imgw_synop.xml';
filename map 'C:\imgw_map.map';
libname imgw xmlv2 xmlmap=map access=readonly;
data xml;
set imgw.item;
run;
proc contents data=xml;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Data set is frequently updated (weather data) and I would like my data to update itself automatically without manual downloads.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS 9.4 in Enterprise Guide 7.11.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jul 2018 13:42:11 GMT</pubDate>
    <dc:creator>olearczuk</dc:creator>
    <dc:date>2018-07-11T13:42:11Z</dc:date>
    <item>
      <title>XML LIBNAME reading data from URL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-LIBNAME-reading-data-from-URL/m-p/477071#M122810</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i am attempting to read data in XML format from URL:&lt;/P&gt;&lt;P&gt;&lt;A href="https://danepubliczne.imgw.pl/api/data/synop/format/xml" target="_self"&gt;https://danepubliczne.imgw.pl/api/data/synop/format/xml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I can't method presented below to work.&lt;/P&gt;&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=engxml&amp;amp;docsetTarget=n1d4p29qcfovrxn1k4nalh0bz4n6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=pl" target="_self"&gt;http://documentation.sas.com/?docsetId=engxml&amp;amp;docsetTarget=n1d4p29qcfovrxn1k4nalh0bz4n6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=pl&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename imgw url 'https://danepubliczne.imgw.pl/api/data/synop/format/xml';
filename map 'C:\imgw_map.map';
libname imgw xmlv2 xmlmap=map access=readonly;
data xml;&lt;BR /&gt;set imgw.item;&lt;BR /&gt;run;&lt;BR /&gt;proc contents data=xml;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;imgw_map was created in SAS XML Mapper using 'AutoMap using XML' on a download data file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code doesn't return any errors, imgw library is created with 2 files, but unfortunately those sets are empty (no observations).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Surprisingly using nearly identical code, but for downloaded data gives correct results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename imgw 'C:\imgw_synop.xml';
filename map 'C:\imgw_map.map';
libname imgw xmlv2 xmlmap=map access=readonly;
data xml;
set imgw.item;
run;
proc contents data=xml;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Data set is frequently updated (weather data) and I would like my data to update itself automatically without manual downloads.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS 9.4 in Enterprise Guide 7.11.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 13:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-LIBNAME-reading-data-from-URL/m-p/477071#M122810</guid>
      <dc:creator>olearczuk</dc:creator>
      <dc:date>2018-07-11T13:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: XML LIBNAME reading data from URL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-LIBNAME-reading-data-from-URL/m-p/483352#M125336</link>
      <description>&lt;P&gt;The URL is a service returning the data which your browser is displaying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To capture the data you have to use either proc http or proc soap.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added a code snippet for your reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename resp "&amp;amp;WORKING_DIR./output.xml";
proc http 
url="&amp;amp;URL_ADVERSE." 
out=resp
METHOD='GET';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please let us know if it worked for you.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 11:33:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-LIBNAME-reading-data-from-URL/m-p/483352#M125336</guid>
      <dc:creator>Satish_Parida</dc:creator>
      <dc:date>2018-08-02T11:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: XML LIBNAME reading data from URL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-LIBNAME-reading-data-from-URL/m-p/792056#M253780</link>
      <description>Great tip!  This helped me a lot right now.</description>
      <pubDate>Tue, 25 Jan 2022 03:17:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-LIBNAME-reading-data-from-URL/m-p/792056#M253780</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2022-01-25T03:17:38Z</dc:date>
    </item>
  </channel>
</rss>

