BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I hope someone can help me. I am endeavoring to output a number of SAS datasets to XML using the following example libname statements

libname xml1 xml "f:\xml\myxml\xml1.xml";
libname xml2 xml "f:\xml\myxml\xml2.xml";
and so on ....
libname xml9 xml "f:\xml\myxml\xml9.xml";

I then attempt to read the XML documents created into EXCEL 2007. My problem relates to the xml data all having the outer container being called How do I get around this problem ?

David
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Unless you REALLY need the libname engine, I would recommend that you use the ExcelXP destination to create your files. That's because ExcelXP writes the kind of XML that Excel "likes" -- Microsoft came up with Spreadsheet Markup Language XML in Office 2002/2003 and ODS has been able to create this specific kind of XML since SAS 9 first came out.

If you use the LIBNAME engine, you get "generic" tabular XML -- and, as you have discovered, Excel may or may not be happy with that form of XML. The only way to change the <TABLE> tag is to modfy the tagset template definition using PROC TEMPLATE.

I recommend that you try this:

[pre]
ods tagsets.excelxp file='f:\myxml\xml1.xml' style=sasweb;
proc print data=lib.file1;
run;
ods tagsets.excelxp close;

ods tagsets.excelxp file='f:\myxml\xml2.xml' style=sasweb;
proc print data=lib.file2;
run;
ods tagsets.excelxp close;
[/pre]

cynthia

sas-innovate-white.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.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

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