Help using Base SAS procedures

Displaying Title when exporting SAS to Excel

Reply
N/A
Posts: 0

Displaying Title when exporting SAS to Excel

Hello,

I am using the option tagsets.ExcelXP to "export" my SAS procedures to Excel. At the moment, even though a title is entered and is displaying in the SAS html file created, no title appear in the Excel I'm creating.

Here is the code I'm using (simplified for your benefit) :

ods listing close;
ods tagsets.ExcelXP file='\[...]\TEST101.XLS';
ods tagsets.excelxp options(sheet_name="Purchase 90%");

PROC TABULATE

[running a standard table procedure here]

TITLE1 'Data for product Purchase 90%';

RUN;


ods tagsets.excelxp options(sheet_name="Purchase 95%");

PROC TABULATE

[running a standard table procedure here]

TITLE1 'Data for product Purchase 95%';

RUN;

ods tagsets.ExcelXP close;

Any idea? Many thanks! Message was edited by: SamuelG.
SAS Super FREQ
Posts: 8,743

Re: Displaying Title when exporting SAS to Excel

Hi:
(You might want to post ODS questions to the ODS Forum in the future...)

With the TAGSETS.EXCELXP destination, you are NOT creating HTML files. You are creating Spreadsheet Markup Language XML files that comply with the Microsoft Office 2003 XML specification for workbooks/worksheets.

By default, the SAS title is put into the "print header" of the worksheet. So you should see it in Print Preview mode.

Otherwise, if you invoke the tagset with the suboption doc="Help", you will see that there are some other suboptions you can specify that will put the titles into the body of the worksheet. Try this:
[pre]
ods tagsets.ExcelXP file='c:\temp\title.xls' style=sasweb
options(doc="Help" embedded_titles="Yes");

proc print data=sashelp.class;
title 'this is the title';
run;

ods _all_ close;
[/pre]

The help information will be in the SAS log after this program runs.

cynthia
N/A
Posts: 0

Re: Displaying Title when exporting SAS to Excel

Many thanks Cynthia!

This trick worked just fine.
Ask a Question
Discussion stats
  • 2 replies
  • 101 views
  • 0 likes
  • 2 in conversation