BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
rezze27
Calcite | Level 5

Good morning, I have a strange issue: I need to exclude all the outputs of a PROC STDRATE with a BY statement from my ODS RTF file output when. Here is an example, you need to set your own file path &fl_path (sorry for the bad formatting, but I couldn't get through the bugs in the suggested method):

 

data dts;
input tme $ trt $ x n;
datalines;
1 A 59 17775
1 B 330 74533
2 C 45 72367
2 D 330 74533
;
run;


ODS RTF bodytitle_aux NOTOC_DATA FILE=&fl_path;

 

ods exclude all;
proc stdrate data=dts method=mh stat=rate(mult=100) effect=diff cl=normal plots=none;
by tme;
population group(order=data)=trt event=x total=n;
run;

 

ODS RTF close;

 


I'm using an ODS EXCLUDE ALL as it always work, but in this case I get an unwanted "The STDRATE Procedure" in my output file, without any other SAS output. I get the same results by excluding only the tables created inmy case (ods exclude stdinfo StdRate effect;). To note: when not using a BY statement I have no issue! I suspect that it can be related to the fact that the ods table related to the method=mh has no name (see p. 9406 of STDRATE procedure documentation). I'm using SAS 9.4 with EG 8.3. What do you think? Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kathryn_SAS
SAS Employee

This is caused by the BODYTITLE_AUX option on the ODS RTF statement. The BODYTITLE option also shows this behavior. If you remove the option, the output and procedure title are not shown. Another option would be to use Tagsets.RTF where BODYTITLE is the default.

ods listing close;
ODS tagsets.rtf FILE='c:\temp\test.rtf';

ods exclude all;

proc stdrate data=dts method=mh stat=rate(mult=100) effect=diff cl=normal plots=none;
by tme;
population group(order=data)=trt event=x total=n;
run;

ODS _all_ close;
ods listing;

View solution in original post

3 REPLIES 3
yabwon
Amethyst | Level 16

Looks like a ODS RTF output and PROC STDRATE  bug to me.  

 

When you test it with ODS PDF or ODS Html, or ODS Listing it "works."

The PDF is not generated at all, the HTML has an empty body (plus a ton of css), and the listing is just an empty file (0 bytes). 

%let fl_path="R:\test.rtf";

%let fl_path2="R:\test.pdf";

%let path3="R:\";
%let fl3="test.html";

%let fl_path4="R:\test.lst";

data dts;
input tme $ trt $ x n;
datalines;
1 A 59 17775
1 B 330 74533
2 A 45 72367
2 B 330 74533
;
run;


ODS noproctitle;
ODS RTF bodytitle_aux NOTOC_DATA FILE=&fl_path.;
ODS pdf FILE=&fl_path2.;
ODS html path=&path3. body=&fl3.;
ods listing file=&fl_path4.;
title;
ods select none;
proc stdrate data=dts method=mh stat=rate(mult=100) effect=diff cl=normal plots=none;
by tme;
population group(order=data)=trt event=x total=n;
run;
ods select all;
ODS RTF close;
ODS pdf close;
ODS html close;
ods listing close;

 

I'd contact SAS tech support.

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



Kathryn_SAS
SAS Employee

This is caused by the BODYTITLE_AUX option on the ODS RTF statement. The BODYTITLE option also shows this behavior. If you remove the option, the output and procedure title are not shown. Another option would be to use Tagsets.RTF where BODYTITLE is the default.

ods listing close;
ODS tagsets.rtf FILE='c:\temp\test.rtf';

ods exclude all;

proc stdrate data=dts method=mh stat=rate(mult=100) effect=diff cl=normal plots=none;
by tme;
population group(order=data)=trt event=x total=n;
run;

ODS _all_ close;
ods listing;
rezze27
Calcite | Level 5

Thank you! That was enough for my specific case, as I didn't actually need the BODYTITLE_AUX

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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
  • 3 replies
  • 360 views
  • 7 likes
  • 3 in conversation