%macro ESC4RTF(str); %if %quote(%substr(%sysfunc(getoption(ENCODING)),1,3)) = %quote(UTF) %then %nrquote(%sysfunc(tranwrd( %nrquote(%sysfunc(UNICODEC(%str(&str),%str(NCR)))), %NRQUOTE(&#), %NRQUOTE(\u) ))); %mend; ods rtf file="test.rtf"; proc report data=sashelp.class style(report)={pretext="%ESC4RTF(受试对象)" posttext="%ESC4RTF(后置文本)"} ; column name sex age weight height; define name/display; run; ods rtf close;