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 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!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

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