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
code
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 ;
run;
Ods tagset.excelxp close;
Hi:
%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.
cynthia
ods tagsets.excelxp file='c:\temp\two_together.xls'
style=sasweb
options (sheet_interval='None'
embedded_titles = "yes");
Proc print data=sashelp.class(obs=3)
noobs;
Title "Class";
run;
Proc print data=sashelp.shoes(obs=3);
title 'Shoes';
run;
Ods _all_ close;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.