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
Diamond | Level 26
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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