DATA Step, Macro, Functions and more

XML LIBNAME reading data from URL

Reply
Regular Learner
Posts: 1

XML LIBNAME reading data from URL

Hi,

i am attempting to read data in XML format from URL:

https://danepubliczne.imgw.pl/api/data/synop/format/xml

 

Unfortunately I can't method presented below to work.

http://documentation.sas.com/?docsetId=engxml&docsetTarget=n1d4p29qcfovrxn1k4nalh0bz4n6.htm&docsetVe...

 

My code is following

 

 

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;
set imgw.item;
run;
proc contents data=xml;quit;

 

 

imgw_map was created in SAS XML Mapper using 'AutoMap using XML' on a download data file.

 

Code doesn't return any errors, imgw library is created with 2 files, but unfortunately those sets are empty (no observations).

 

Surprisingly using nearly identical code, but for downloaded data gives correct results.

 

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;

Data set is frequently updated (weather data) and I would like my data to update itself automatically without manual downloads.

 

I am using SAS 9.4 in Enterprise Guide 7.11.

 

best regards.

 

 

 

 

 

 

 

 

Ask a Question
Discussion stats
  • 0 replies
  • 61 views
  • 0 likes
  • 1 in conversation