BookmarkSubscribeRSS Feed
SNLFAM1
Obsidian | Level 7

We recieve data shipped to us as large complex XML files with an XML schema included.  Using the SAS XML Mapper 9.4 and the schema, I was able to use the "Auto Generate" process to create an XML Map (with auto generated keys) from the XML schema.  This resulted in the XML being divied up into over 300 tables.  I ran PROC COPY to pull all the tables into SAS... and it took about 2 days to finish.  I tried the same XML file and XML map and ran a DATA step for one table.  That step took a little more than 5 minutes.  It appears based on the log that for each table, SAS reads through the entire XML file again.  Is there a way to output to multiple SAS datasets with only one read through of the XML?

--Shaun

 

Code run on SAS 9.4 UNIX server:

filename DataWare "/sas/data/LARGE.xml";
filename SXLEMAP "/sas/data/XML Maps/LARGE_AUTO.map";
libname DataWare xmlv2 xmlmap=SXLEMAP access=READONLY;
libname tempo "%sysfunc(getoption(WORK))";

proc copy in=DataWare out=tempo;
run;

1 REPLY 1
M2
Calcite | Level 5 M2
Calcite | Level 5

If you don't really need the 300 different tables, manually construct the xml map by drag and drop of items to create a single larger denormalised table.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1 reply
  • 715 views
  • 0 likes
  • 2 in conversation