BookmarkSubscribeRSS Feed
Hadrien
Obsidian | Level 7

For some reason, the wrong title shows up on my Results page when I use the ODS TEXT command. My code is set-up like this:

 

ODS TEXT = 'Calculate summary statistics of USA residents';
TITLE "USA Residents";
PROC PRINT DATA=USASummary; RUN;

ODS TEXT = 'Calculate summary statistics of France residents';
TITLE  "France Residents";
PROC PRINT DATA=FranceSummary; RUN;

ODS TEXT = 'Calculate summary statistics of German residents';
TITLE  "German Residents";
PROC PRINT DATA=GermanSummary; RUN;

The France and Germany summary tables have the correct titles, but the USA table has the title "France Residents". If I remove the ODS TEXT command, the correct title shows up. Does anyone know why this might be happening? My main goal is to generate a final report with some descriptive text that explains the analysis, not sure if there are other commands I could use other than ODS TEXT?

 

Thank you

2 REPLIES 2
PGStats
Opal | Level 21

You don't say what your ODS destination is, but I get the expected layout in RTF with:

 


ods rtf file="&sasforum\Reports\testTEXT.rtf";

TITLE "USA Residents";
ODS TEXT = 'Calculate summary statistics of USA residents';
PROC PRINT DATA=USASummary; RUN;

ods rtf startpage=now;
TITLE  "France Residents";
ODS TEXT = 'Calculate summary statistics of France residents';
PROC PRINT DATA=FranceSummary; RUN;

ods rtf startpage=now;
TITLE  "German Residents";
ODS TEXT = 'Calculate summary statistics of German residents';
PROC PRINT DATA=GermanSummary; RUN;
ods rtf close;
PG
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Why do you want to use ods text in this way.  Why not just put another title line in (which is what you are doing);

title "USA Residents";

title2 "Calculate...";

...

 

You can manipulate font and position of the title to look like a subheader.

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
  • 1171 views
  • 0 likes
  • 3 in conversation