BookmarkSubscribeRSS Feed
VD
Calcite | Level 5 VD
Calcite | Level 5

Hello,

I am creating an rtf file using ods in a stored process (without specifying any path). The default name of the file comes out to be do.doc which I want to change to something more meaningful. Is anyone aware of how to do it? I am using the following settings in the header of the code file:

%if ( &REPORTFORMAT=RTF ) %then %do;

  %let _odsdest=RTF;

%end;

I also use this statement in the body of the code file:

ods rtf style=rtf bodytitle startpage=no nokeepn notoc_data nogfootnote ;

Thanks.

VD.

2 REPLIES 2
AncaTilea
Pyrite | Level 9

So, if I understand correctly and you want just to assign a name but not the full path you cna do somehting like this:

ods rtf style=rtf bodytitle startpage=no nokeepn notoc_data nogfootnote  file = "meaningful_name.rtf";

Does this help?

I hope so.

VD
Calcite | Level 5 VD
Calcite | Level 5

AncaTilea,

Thank you for your reply.

I found this piece of code (for the header section) which helped to resolve the filename:

%if ( &REPORTFORMAT=RTF ) %then %do;

  %let _odsdest=RTF;

%let rv = %sysfunc(appsrv_header(Content-type,application/msword));

    %let rv = %sysfunc(appsrv_header(Content-disposition,attachment%nrstr(;)

filename=meaningful_name.rtf));

%end;

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
  • 2 replies
  • 931 views
  • 0 likes
  • 2 in conversation