DATA Step, Macro, Functions and more

Data generates multiple times in RTF file

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 8
Accepted Solution

Data generates multiple times in RTF file

Hi ,

 

   ODS RTF Body='C:\Users\Desktop\SASWorkshop\Q.rtf';
   Proc Print Data=Cars;
   Sum MSRP Length;
   Where Make='Toyota';
   Run;

 

  It generates the data multiple times in RTF file. I have attached the screenshot also.

Can anyone tell me why I am getting multiple times.

 

Thanks


RTF.png

Accepted Solutions
Solution
2 weeks ago
Super User
Super User
Posts: 7,413

Re: Data generates multiple times in RTF file

Do note my response - that is not the complete code.  You are missing:
ods rtf close;

 

At minimum.  Without that line of code you will not get a readable file.  Please post full code.

View solution in original post


All Replies
Trusted Advisor
Posts: 1,395

Re: Data generates multiple times in RTF file

Is this all your code or is it a part of the code?


Divya_Joseph wrote:

Hi ,

 

   ODS RTF Body='C:\Users\Desktop\SASWorkshop\Q.rtf';
   Proc Print Data=Cars;
   Sum MSRP Length;
   Where Make='Toyota';
   Run;

 

  It generates the data multiple times in RTF file. I have attached the screenshot also.

Can anyone tell me why I am getting multiple times.

 

Thanks


 

Occasional Contributor
Posts: 8

Re: Data generates multiple times in RTF file

Hi,

It is not a part of code. This is the full code . Without using ODS syntax we just see the result in HTML view. So I am trying to store this into external file as RTF file. But when I execute this code I got result multiple times in RTF file. This code is fine in case of to store as exel,html and pdf.

Thanks

Solution
2 weeks ago
Super User
Super User
Posts: 7,413

Re: Data generates multiple times in RTF file

Do note my response - that is not the complete code.  You are missing:
ods rtf close;

 

At minimum.  Without that line of code you will not get a readable file.  Please post full code.

Occasional Contributor
Posts: 8

Re: Data generates multiple times in RTF file

It is working When I use ods rtf close;

 

Thank you

Super User
Super User
Posts: 7,413

Re: Data generates multiple times in RTF file

That isn't the complete code is it, you haven't, for instance, got an ods rtf close at the end of the so the file gets written.  Post the whole code, and the log if possible into code windows (this is using the {i} above the post area).

☑ This topic is SOLVED.

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

Discussion stats
  • 5 replies
  • 237 views
  • 2 likes
  • 3 in conversation