BookmarkSubscribeRSS Feed
tburus
Obsidian | Level 7

I have a large data report where I am opening the ODS RTF output file and then calling several files using %include to fill in the content. These documents contain various data manipulations, followed by the output I desire to have. All of them run fine with the exception of one. In that file I am using a number of statements similar to the following:

ods exclude all; 
ods output OddsRatio(persist=proc)=odds_basb_act(where=(Statistic="Column 2 Relative Risk"));
proc surveyfreq data=GLSDesign_basb3;
   	strata strata;
	weight nationalweight;
	tables sport_name_girls_softball*(act_:)/ or noprint;
run;
proc surveyfreq data=GLSDesign_basb3;
	strata strata;
	weight nationalweight;
	tables sport_name_boys_baseball*(act_:)/ or noprint;
run;
ods output close;
ods exclude none;

I expected this to be ignored by the output, but instead it appears to be creating a blank line (or several) in the ODS RTF output every time it runs. How can I correct this?

5 REPLIES 5
ChrisNZ
Tourmaline | Level 20

Have you tried this
To temporarily suspend a destination, use ODS SELECT NONE. Use ODS SELECT ALL when you want to resume sending output to the suspended destination.
as stated in the documentation?

tburus
Obsidian | Level 7
After your comment I did, but it made no difference. Thanks for the suggestion, though.
Cynthia_sas
SAS Super FREQ
Hi:
Well, have you tried doing the SURVEYFREQ steps completely outside of the ODS RTF "sandwich". For creating some procedure output at least one destination has to be open in order for the procedure to run. I'm not sure of how SURVEYFREQ works but that might be one of them. I assume you want to get the output from the ODS OUTPUT statement to use with ODS RTF in some way, so my tendency is to let everything go to ODS HTML, which is usually the default and then do all my intermediate work so the output goes there for checking and then I put only the step I want inside the ODS RTF destination statements. But like I said, you may have tried that already and found it undesirable for some reason.
Cynthia
tburus
Obsidian | Level 7

Thanks for the information. Yes, I did remove it from the ODS RTF sandwich and the issue went away. This is doable, but something I was trying to avoid.because it disrupts the normal flow of the overall document—a report where each section has been created as a stand-alone file including its own data work followed by RTF output, all glued into a master using %INCLUDE. The PROC SURVEYFREQ serves to generate relative risk CIs that are included in a data table used in a PROC REPORT statement. To get this issue to go away, I separated the data and desired output portions into two files for that section and ran the data portion before the initial opening of the ODS RTF output in the master file.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 5 replies
  • 938 views
  • 1 like
  • 3 in conversation