BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I'm trying to use the Embed_titles_once option but the titles will always appear before every table no matter where I

I tried the sample code in an earlier thread (appended below) & the titles also appeared before the table.

ods tagsets.ExcelXP file="sample_report_v7_sql.xls" style=sasweb ;

*Create First/Report Fake Title Page;
ods tagsets.ExcelXp options(sheet_name='Title Page' sheet_interval='none');
proc report data=sashelp.class nowd noheader; where name = 'Alfred';
column name age height weight;run;

*Create second tab;
ods tagsets.ExcelXp options(embedded_titles='yes' EMBED_TITLES_ONCE='yes'sheet_name='2.4.1.2 Business Unit HA'sheet_interval='none');

proc report data=sashelp.class nowd; title 'My Second Sheet';
where sex = 'F';run;
proc report data=sashelp.class nowd;
where sex = 'M';run;

*Create third and fourth tab;
ods tagsets.ExcelXp options(embedded_titles='yes' EMBED_TITLES_ONCE='yes' sheet_name='Consumer Business Unit HA' sheet_interval='page');
proc report data=sashelp.shoes nowd; title 'Slippers'; where product = 'Slipper' and region in ('Pacific', 'Western Europe');
define region / group; break after region /page;run;

ods _all_ close;

Is anyone able to advise where or how we can use the Embed_titles_once option?
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
If you change sheet_interval='none' to sheet_interval='table', then the embed_titles_once works as advertised. My guess is there's some interaction between embed_titles_once and sheet_interval='none' -- what happens is that ODS builds all of the first table and then builds all of the second table and then puts the 2 tables together in 1 bigger table. Part of that building the tables before putting them together must include the title. You'd have to work with Tech Support for a definitive explanation.

For the 2 PROC REPORT scenario, you can get rid of the title on the second output, by simply issuing a NULL TITLE statement as shown in the (simplified) code below.

cynthia
[pre]
ods tagsets.ExcelXP file="c:\temp\sample_report_v7_sql.xls" style=sasweb
options(embedded_titles='yes' EMBED_TITLES_ONCE='yes' sheet_name='Something' sheet_interval='none');

proc report data=sashelp.class nowd;
title 'My Sheet title';
where sex = 'F';
run;

title; /* reset title statement */

proc report data=sashelp.class nowd;
where sex = 'M';
run;

ods tagsets.Excelxp options(sheet_interval='table');

title 'A Sheet for Every Age';
proc report data=sashelp.class nowd;
column age name sex height weight;
define age / order;
break after age / page;
run;

ods _all_ close;
[/pre]
deleted_user
Not applicable
thanks for the quick response cynthia!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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