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

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
1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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

5 REPLIES 5
Shmuel
Garnet | Level 18

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


 

Divya_Joseph
Calcite | Level 5

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

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Divya_Joseph
Calcite | Level 5

It is working When I use ods rtf close;

 

Thank you

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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).

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register 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.

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
  • 953 views
  • 2 likes
  • 3 in conversation