BookmarkSubscribeRSS Feed
mick_g
Calcite | Level 5

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;

1 REPLY 1
Cynthia_sas
SAS Super FREQ

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

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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