The SAS Output Delivery System and reporting techniques

xml table with ods

Posts: 37

xml table with ods

Is there a way to incorporate an xml table into an ODS tagsets.excelxp proc print statement or can I incorporate it in mystyle (style sheet) or is there any other way?  I need to add an xml table to the underneath this rpt.  I do not have access to create the xml table in SAS I only get the result to be placed into the excel sheet with these results.

Thanks for any help


Ods listing close;

%include Old_data.xml

define style styles.mystyle;

parent = styles.statictical;

    replace colors /

      'titlebg' = "#FFFFFF"

      'titlefg' = "#000000";  

    replace fonts /

      'titleFont' = ("Georgia,Roman",18pt,bold);

ods tagsets.excelxp file = test style=mystyle options (autofilter="all" embedded_titles = "yes");

Proc print data=test_file label split = "_" noobs;

Title "Detail";

Title "as of: today"

Label add_time = "Time_entry_made"

         FC = "False_Code_Enter"

         CC = "Correct_Code_Enter"

Proc print data=old_data.xml ;


Ods tagset.excelxp close;

Posts: 8,743

Re: xml table with ods


  %include is including code to go to the compiler. Generally, you use %INCLUDE when you have a code snippet that you want to use over and over again. I am not entirely clear on what you want or need to do with the information you have in the old_data.xml file -- or, whether old_data.xml is in a form that TAGSETS.EXCELXP could deal with. If your old_data.xml file violates any of the XML "rules" for Excel's Spreadsheet Markup Language, it is possible that Excel would never open the file because of an XML error.

  If you want to show 2 tables in one Excel worksheet, using TAGSETS.EXCELXP, then I believe you only have to change the sheet_interval suboption. For example, it is a silly thing to do, but I have put some rows from SASHELP.SHOES immediately underneath rows from SASHELP.CLASS, using the program below. If you can read your XML table into a SAS dataset or perhaps use the SAS Libname XML Engine to read your XML table, you could then use PROC PRINT on it. However, you can't use %INCLUDE the way you attempted to do what you want to do.

  Perhaps Tech Support could be of more help with this task.


ods tagsets.excelxp file='c:\temp\two_together.xls'
     options (sheet_interval='None'
              embedded_titles = "yes");
Proc print data=sashelp.class(obs=3)
Title "Class";
Proc print;
title 'Shoes';
Ods _all_ close;

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation