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!
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;
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
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;
Thank you! That was enough for my specific case, as I didn't actually need the BODYTITLE_AUX
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →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.
Ready to level-up your skills? Choose your own adventure.