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

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