It's helpful to see your macro code, but it's still hard to help without a small reproducible example. Typically for something like this you can create a small dataset (3-5 records) using the CARDS statement, and focus on only the problematic code. Often when you take the time to make a reproducible example that you can share, you will find the answer yourself.
Another rule when working on something you think is a macro language problem, is to get the code working first without the macro language. This is helpful even when you've inherited a macro and you need to update it.
I took your macro, made a tiny example, got it to run, and then realized the problem isn't in the macro language, I think the problem is that in your PROC REPORT step, you set borderwidth to 0, so when your CALL DEFINE turns on borders, they still have a width of zero.
Below is my play code. I suggest you play with something like this, to get it working like you want, with your real data. Then after you have hard-coded SAS code that works like you want, return to the macro language to work on the macro design.
data BO_WEEKLY_RESULTS ;
input Category : $4. Wow : $1. ;
cards ;
CAT1 A
Dog B
CAT C
;
ods tagsets.ExcelXP style=sasweb path= "%sysfunc(pathname(work))" file= "try.xls" Style=Printer; *why are there two style= specifications? ;
proc report data=BO_WEEKLY_RESULTS split='#' spanrows
style(report)=[outputwidth = 100% cellspacing=0 cellpadding=2 frame = hsides rules=groups font=(Arial, 8pt, bold)]
style(header)=[foreground=white background=CX0066a4/*00669A*/ font=(Arial, 9pt, bold) borderbottomwidth=0 bordertopwidth=0 borderrightwidth=0 borderleftwidth=0 bordercolor=white NOBREAKSPACE=ON ]
style(column)=[font=(Arial, 8pt) foreground=black background=CXFFFFFF VJUST=C borderbottomwidth=0 bordertopwidth=0 borderrightwidth=0 borderleftwidth=0 bordercolor=white ]
;
Columns
CATEGORY
WOW
;
Define WOW / CENTER "WOW PCT";
Compute WOW;
if CATEGORY IN ('CAT1') then Call Define (_COL_,'STYLE','STYLE=[borderbottomcolor=red borderbottomwidth=2]');
else if CATEGORY IN ('CAT') then Call Define (_COL_,'STYLE','STYLE=[bordertopcolor=red bordertopwidth=2]');
endcomp;
run;
ods tagsets.ExcelXP close;
That code 'works' for me (in the sense that it conditionally adds a red border). But it's probably not what you want, as the cells lose the other borders. So this will still need some tinkering. Perhaps you can set borderwidth on the style(column) option instead.
... View more