The SAS Output Delivery System and reporting techniques

ods rtf filename

Reply
Frequent Contributor
Frequent Contributor
Posts: 94

ods rtf filename

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.

Super Contributor
Posts: 543

Re: ods rtf filename

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.

Frequent Contributor
Frequent Contributor
Posts: 94

Re: ods rtf filename

Posted in reply to AncaTilea

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(Smiley Wink

filename=meaningful_name.rtf));

%end;

Ask a Question
Discussion stats
  • 2 replies
  • 232 views
  • 0 likes
  • 2 in conversation