Hello, I would like to output several tables with no blank between the different tables, thanks to ODS RTF. The result I get : N % Variable 1 Modality 1 Modality 2 BLANK Variable 2 Modality 1 Modality 2 The result I would like : N % Variable 1 Modality 1 Modality 2 Variable 2 Modality 1 Modality 2 Here is the code I use : OPTIONS ORIENTATION=LANDSCAPE CENTER NODATE NONUMBER ; TITLE ; FOOTNOTE ;
ODS RTF body="myfile" STARTPAGE=NO BODYTITLE STYLE=styles.journal;
ODS ESCAPECHAR='~' ; ODS NOPROCTITLE ; ods rtf text="~{STYLE[just=c vjust=c outputheight=0.5cm outputwidth=100% font_weight=bold font_size=10pt FONT_FACE ='couriernew, courier']}";
PROC REPORT data = mytable......
PROC REPORT data = mytable......
PROC REPORT data = mytable......
ODS RTF CLOSE ; The only solution I found is a macro from the article "Constructing stack tables with Proc Report and ODS RTF" written by Lei Zhang. %Macro glue(in=, out=);
%local QueueSize;
%let QueueSize=5;
filename infile "&in";
filename outfile "&out";
data _TMPDSN;
length rtfcode $32000;
infile infile; * original rtf tables created by ODS;
input;
rtfcode=_infile_;
length=length(trim(rtfcode));
run;
data _null_;
file outfile; * rtf stack table with no gaps between child tables;
set _TMPDSN end=last;
array queue{&QueueSize} $32000 _temporary_;
retain queue;
retain count 0;
count = count + 1;
queue[count] = rtfcode;
if count = &QueueSize then do;
found = 0;
if (queue{1} = '\pard{\par}' and
queue{2} = '{\par}{\pard\plain\qc{' and
queue{3} = '}\par}{\par}' and
queue{4} = ' ') then do;
if (compress(translate(queue{&QueueSize},"", "0123456789")) =
'\sect\sectd\linex\endnhere\sbknone\headery\footery\marglsxn\margrsxn\margtsxn\margbsx
n') then found=1;
end;
if found then do;
count=0;
end; else do;
put queue{1};
do i = 2 to &QueueSize;
queue[i-1]=queue[i];
end;
count = count -1;
end;
end;
if last then do;
do i = 1 to count;
put queue{i};
end;
end;
run;
%Mend glue; It takes the RTF file as a parameter and returns a new file with stuck tables. It works perfectly for a document with portrait orientation but doesn't word in landscape orientation. Does anyone have a solution for a landscape file ? Thank you, G.
... View more