BookmarkSubscribeRSS Feed
Ce_Wo
Calcite | Level 5
Hi Everyone,

I have been searching the net with no luck and thought i would try here.

We use some SOA services and as a result customer information is stored to an XML file in a SQL database a customer level.

i have had no joy in finding how to import multiple records from an SQL DB.

Has any one had any exprience doing this i.e pulling in multiple XML files to a single sas dataset?

Any assistance would be greatly appreciated.
2 REPLIES 2
ChrisHemedinger
Community Manager
You can use the XML library engine in SAS to read XML as data. Use SAS XML Mapper to create a map file (schema rules) for how to interpret the XML you're reading.

You'll have to do this for each XML source you're working with, and then use DATA step or SQL to merge the multiple result tables together.

Here's an example of using the XML library engine:

http://blogs.sas.com/sasdummy/index.php?/archives/55-Mining-the-VP-debate-results-according-to-Twitt...

Chris
Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
Ce_Wo
Calcite | Level 5
Thanks Chris - I really appreciate your reply.


The XML Map and XML libname engine is the second part of the project. I almost have this covered, the link you provided is a great help and confirms I am on the right track.

The major issue I have is the XML data is being stored into a SQL database which I access through SAS via an ODBC Connection with the XML being quite complex + more than 1024bytes + multiple XML with different mappings.

My temporary solution so far is to use the SQL pass through to call a stored procedure (with SAS macro to pass through variables needed).

The stored procedure then uses BCP to save the XML files on my network.

Then it moves on the to the second stage that you have pointed out.

I am still in the testing stage and will post the solution when i am happy with the results.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1267 views
  • 0 likes
  • 2 in conversation