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
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 1061 views
  • 0 likes
  • 2 in conversation