Hi:
You are not showing your entire ODS RTF invocation (so we can see whether you have any relevant ODS RTF options or what ODS STYLE= option you are using. You show how &var and how &var1 get set, but you do not show how &var2 or &num are assigned values. (As an aside...personally, I would never put the macro definition (the %MACRO/%MEND --inside the PROC REPORT step -- conceptually, the definition of the macro program can (and probably would be better understood if it were) defined -outside- of the PROC REPORT step. You do not have to put your macro definition inside the PROC REPORT step in order to use it there. However, that is a minor issue compared to some of the other possible issues with your CELLHEIGHTS.)
You have hardcoded cellheights for every DEFINE statement for &VAR; you have a hardcoded cellheight for STYLE(REPORT); and hardcoded, but different cellheights for COHORT, USUBJID, DATE and LP. So it might be possible that you are specifying conflicting cellheights for a single report header area....at a guess. Generally speaking, SAS/PROC REPORT/ODS would want EVERY column on the same row to be the SAME cellheight. I would expect that the cellheight for your spanned header might be able to be a different height, but the basic cellheight for all headers that are in the same "row" would all need to be the same height. It is possible that ODS will not, in fact, give you an error message because it doesn't see anything wrong with differing cellheights. But it's also possible that either ODS or Word just "readjusts" the cellheights behind the scenes.
For example, if I use this code on SASHELP.CLASS, removing the macro code because it is an unnecessary layer of complexity:
[pre]
ods listing close;
ods rtf file='c:\temp\forum_ctrl_strings.rtf';
ods escapechar='^';
proc report NOWD CENTER MISSING
style(column)={font_face= "Times New Roman"
font_size=9pt asis=on background=_undef_
font_weight= medium }
style(report)={cellheight=.25in cellpadding=0pt
rules=group frame=void background=_undef_}
style(header)={BOTTOMMARGIN = 0IN font_face= "Times New Roman"
font_size=9pt background=_undef_
font_weight= medium just=c}
data =sashelp.class
split = "|"
nowindows;
columns sex name age
("^R/RTF'\brdrb\brdrs\brdrw1'something|" height weight height=ht2 weight=wt2) ;
define sex /ORDER NOPRINT ;
define name/ORDER style(column)=[cellwidth=5% ]
style(header)=[cellheight=0.10IN]center "xxxx ";
define age/display style(column)=[cellwidth=5% ]
style(header)=[cellheight=0.10IN]center "xxxxx";
define height/display style(column)=[cellwidth=3% ]
STYLE(HEADER)=[CELLHEIGHT=0.45IN]center '1.';
define weight/display style(column)=[cellwidth=3% ]
STYLE(HEADER)=[CELLHEIGHT=0.45IN]center '2.';
define ht2/display style(column)=[cellwidth=3% ]
STYLE(HEADER)=[CELLHEIGHT=0.45IN]center '3.';
define wt2/display style(column)=[cellwidth=3% ]
STYLE(HEADER)=[CELLHEIGHT=0.45IN]center '4.';
compute BEFORE sex;
line 'LINE before ';
endcomp;
run;
ods _all_ close;
[/pre]
And then, if I look at the generated RTF for the "row" with NAME, AGE, HEIGHT, WEIGHT, HT2 and WT2 -- inside Word, when the RTF file is rendered, the report row for those header cells is exactly .45" for every cell, in spite of the fact that NAME, and AGE had cellheights of .1" and the other variables all had cell heights of .45" -- clearly no matter what information ODS sent in the RTF control strings, the word processor (Word) either ignores the differing cellheights or uses the largest of the cellheights that were specified for that row.
In addition, you use some syntax that is odd, in the context of your statement that you are creating ODS RTF output -- for example, PS and LS have no impact on ODS RTF output -- they are LISTING only options.
For the RTF control string that you pass in as "raw" text, I do not understand how you would ever get a dotted line from this: \brdrb\brdrs\brdrw1 control string. As far as I know, those RTF control strings translate to:
\brdrb (set border bottom)
\brdrs (to a single thickness border line)
\brdrw1 (to a width of 1TWIP ...as explained in the spec that normally, you specify brdrwn where N is the width in twips of the pen used to draw the paragraph border line. N cannot be greater than 75. To obtain a larger border width, the \brdth control word can be used to obtain a width double that of N . )
Other possibilities for line style (according to the RTF spec are):
\brdrth Double-thickness border.
\brdrsh Shadowed border.
\brdrdb Double border.
\brdrdot Dotted border.
\brdrdash Dashed border.
\brdrhair Hairline border.
\brdrdashsm Dash border (small).
\brdrdashd Dot dash border.
\brdrdashdd Dot dot dash border.
\brdrtriple Triple border.
\brdrtnthsg Thick thin border (small).
\brdrthtnsg Thin thick border (small).
\brdrtnthtnsg Thin thick thin border (small).
\brdrtnthmg Thick thin border (medium).
from--http://www.biblioscape.com/rtf15_spec.htm
So I would expect you to use a different control string if you wanted a dotted line instead of a single-thickness (or solid) line.
Without seeing all your code and understanding a bit more about why you want to set different cellheights, it's not possible to comment any more. Perhaps these comments will help you a bit. Or you might consider working with Tech Support -- since you could show them ALL your code, and ALL your data and they could make specific suggestions about how to get closer to what you want.
cynthia