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

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