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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1793 views
  • 0 likes
  • 3 in conversation