%let cln=170;
%macro tt;
data code;
do i=0 to 15; col0=put(i, hex1.); output; end; keep col0; label col0="_"; run;
%do k=1 %to &cln;
data _null_; call symput("KK", put(&k, hex2.)); run;
data u&k;
do i=0 to 15;
a=put(&k, hex2.); b=put(i, hex1.); col=compress('<'||'u1F'||a||b||'>');
col&k=unicode(col,'paren'); output;
end;
keep col&k; label col&k="1F&kk";
run;
data code; merge code u&k; run;
%end;
%mend tt;
%tt;
ods rtf file="~/sasout/A Few Unicode.rtf";
proc report data=code;
col col0-col&cln ;
define col0-col&cln / display;
title "A Few Unicodes";
run;
ods rtf close;
run;
Hi Cynthia,
The other day I asked you a question about how many columns an ODS RTF REPORT table supports. I soon found the answer myself, and the quick answer is a lot of columns, with a little caveat: proc report will wrap the columns to fit the page. Attached is an SAS program for a table of 170 columns on a few pages.
Then I saw this line of discussion. I know very little about ODS RTF, but I wonder if I can add a piece of code into the header section of the REPORT table, which I did manually, so I can have a watermark on every page of the table. See the attached RTF file, and the image of the watermark is one of the Unicodes. I wonder if SAS can add a feature of adding code in the header or it already exists. Please let me know.
Many Thanks
Jianmin Long
Hi Cynthia, Thanks for your reply. I have read those comments before and I thought that was then. Recently I have heard a lot good things about ODS TAGSETS.RTF which supports image file through template, for one image file as background?
After I asked the SAS way to insert some code in SAS output headers, I found a way to get around. See the attached SAS code and the output.
RTF specs didn't mention Watermarks, but Shapes. The second attached file has a few more shapes inserted, plus a TOC page it tells where to click.
Many Thanks
Jianmin
options orientation=landscape;
ods rtf file="~/sasout/0test.rtf";
%let title1=Table 1: Student Data;
%let title2=Table 2: 2004 Car Data;
proc report data = sashelp.class;
title &title1;
run;
proc report data= sashelp.cars(obs=30);
title &title2;
run;
ods rtf close;
data _readrtf_;
infile "~/sasout/0test.rtf" missover length=l end=eof lrecl=2000;
input line $varying2000. L;
line=tranwrd(line, "\clcbpat8", "");
line=tranwrd(line, "\clcbpat17", "");
run;
data _null; set _readrtf_;
retain __n 0;
file "~/sasout/0test.rtf" ;
put line;
if line=:"{\header\" then do; __n+1;
%txt(2, 2000, 3200, 60, 4500, z=1, fs=32, an=-90, line=1, lr=128, lg=0, lb=0, o=1, r=255, g=255, b=255, lw=200,
txt=%str(Draft Listing - Please Review));
if __n=1 then do; %wm(wm=&title1); end;
else if __n=2 then do; %wm(wm=&title2); end;
end;
run;
O by the way, SAS ODS TAGSETS.RTF supports watermark nicely. See the code:
ods tagsets.rtf file="~/sasout/test.rtf" style=rtf options(watermark="Student Data");
proc report data = sashelp.class;
run;
ods tagsets.rtf close;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.