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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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