BookmarkSubscribeRSS Feed
grimol
Calcite | Level 5


Hello,

how can I readin this type of XML-File in SAS? How the xmlmap-file must look like?

<?xml version="1.0"?>

<table>

<row>

<column>ID</column>

<column>Spalte2</column>

<column>Spalte3</column>

<column>Spalte4</column>

<column>Spalte5</column>

<column>Spalte6</column>

<column>Spalte7</column>

<column>Spalte8</column>

</row>

<row>

<column>108362</column>

<column>gfdgfd</column>

<column>30161</column>

<column>hgdgfdf</column>

<column>gfdgfdfgd</column>

<column>Deutschland</column>

<column>gfdgfd</column>

<column></column>

</row>

<row>

<column>108363</column>

<column>weqwe</column>

<column>30162</column>

<column>qewq</column>

<column>qeqwe</column>

<column>Deutschland</column>

<column>ewqweq</column>

<column>ewqweq</column>

</row>

</table>

2 REPLIES 2
BillM_SAS
SAS Employee

If you are running the second maintenance release of SAS 9.3 or later, you can use the AUTOMAP option of the XMLV2 Libname engine:

    LIBNAME X XMLV2 "<path to XML file>" AUTOMAP=REPLACE XMLMAP="<path to XML Mapper file created>";

You will need to supply your site specific information for the places I used angle brackets, < >. This will create 3 data sets. The one of interest will be the Columns data set.

If you are running a version of SAS that does not support the AUTOMAP option, you will need to use the XML Mapper application. It is a free download from the SAS Customer Support Knowledge Base and Community web site.

You may also want to read a paper I presented at the 2013 SAS Global Forum that has sections dealing with XML data. The paper is titled, "The Ins and Outs of Web-Based Data with SAS". You can access the paper at:

     Technical Papers and Presentations made by SAS staff

The AUTOMAP option is discussed on page 7.

grimol
Calcite | Level 5

PERFECT. Thank you. I've tried the XML-Mapper but I didnt get the result I want. With the AUTOMAP-Option it works!

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1325 views
  • 1 like
  • 2 in conversation