Proc report to rtf return blank file

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 16
Accepted Solution

Proc report to rtf return blank file

Hi,

I am  trying to write a report to rtf using ods rtf

ods rtf file='file name';

proc report;

...

run;

ods rtf close;

The RTF file is empty with size=0 kb; it's blank when I open it. The report window in SAS does pop up and the report works. When I try using ods rtf with other proc, they work fine

I also try ods html and ods pdf, same thing occurs (blank)

Please advise

Thank you


Accepted Solutions
Solution
‎04-28-2015 04:21 PM
SAS Super FREQ
Posts: 8,718

Re: Proc report to rtf return blank file

Hi:

  Depending on the version of SAS you are running, you might want to change your PROC REPORT statement slightly:

ods rtf file='c:\temp\somefile.rtf';

proc report data=sashelp.class nowd;

*** more code;

run;

ods rtf close;

  In older versions of SAS, you needed to have NOWD as an option in the code or else your output would go to the report window but NOT to ODS destinations. So the fact that you say the report window opens, implies to me that you are getting into interactive report mode when you don't really want to be in that mode. A report created with PROC REPORT can only go to 1 place OR the other, but not both. As long as the output appears in the interactive REPORT window, it will not be sent to ODS.

cynthia

View solution in original post


All Replies
Solution
‎04-28-2015 04:21 PM
SAS Super FREQ
Posts: 8,718

Re: Proc report to rtf return blank file

Hi:

  Depending on the version of SAS you are running, you might want to change your PROC REPORT statement slightly:

ods rtf file='c:\temp\somefile.rtf';

proc report data=sashelp.class nowd;

*** more code;

run;

ods rtf close;

  In older versions of SAS, you needed to have NOWD as an option in the code or else your output would go to the report window but NOT to ODS destinations. So the fact that you say the report window opens, implies to me that you are getting into interactive report mode when you don't really want to be in that mode. A report created with PROC REPORT can only go to 1 place OR the other, but not both. As long as the output appears in the interactive REPORT window, it will not be sent to ODS.

cynthia

Occasional Contributor
Posts: 16

Re: Proc report to rtf return blank file

Thank you. I am using 9.3. Adding the statement corrects the problem

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 309 views
  • 1 like
  • 2 in conversation