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
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;
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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.