BookmarkSubscribeRSS Feed
damiankowalik
Calcite | Level 5

Hi everyone,

I encountered a problem while importing XML file from website. Code:

 

filename test url 'https://www.nbp.pl/kursy/xml/a027z190207.xml';
libname test xml;

proc copy in=test out=work; 
run;

proc print;
run;

The code above causes an error:

 

Przechwytywanie.PNGAs I understand the problem is with handshake/certification. To handle it I found a new source that uses api:

 

filename test url 'http://api.nbp.pl/api/exchangerates/tables/A/?format=xml';
libname test xml;

proc copy in=test out=work; 
run;

proc print;
run;

It causes an error suggesting usin XMLMap. Would you be able to help? I know that it could be done in Python or R, but I would really like to use SAS on this. Thank you in advance.

1 REPLY 1
ChrisBrooks
Ammonite | Level 13

Do you have the XML Mapper application installed? If you do or can install it then you'll find it normally makes creating an XML Map quite an easy process. If not then you'll have to hand-craft one yourself but you'd need to understand how the XML is structured and how you want it to be represented in your Sas Data Set which is a bit more challenging.

 

There's a good paper on it here -> https://www.lexjansen.com/nesug/nesug10/ff/ff14.pdf which is from 2010 but I don't think the Mapper application has changed much if at all since then.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1073 views
  • 0 likes
  • 2 in conversation