Hi there,
I'm using a PROC REPORT to create a table on which I would like to apply a style on certain lines to highlight the change of group (visit in this case). I have found that a break after the visit variable generates exaclty the effect that I'm looking for, but the label of the visit appears now duplicated (in the grey background line, which is the one that I would like to keep, and on the white background line, which I would like to remove). Is there any easy way to avoid this duplicity?
The code of the PROC REPORT is part of a macro:
proc report data=data2report2 nowindows headline style(header)={background=very light grey} missing split='*';
column("&title." &timevar. ('Shift' shift) &stratavar., nval);
define &stratavar./ '' across nozero order=internal;
define &timevar./ f=&timevarfmt. '' group order=internal;
define shift/ f=shiftfmt. '' group order=internal;
define nval/ '' group;
break before &timevar. / summarize style=[background=very light grey];
compute &timevar.;
if &timevar. eq '99999' then do;
call define (_row_,'style', 'style=[font_weight=bold]');
end;
endcomp;
run;
And here is the table that I get where you can see the duplicates:
Thank you for your help!!
Best regards
proc report ...... out=temp /*Check the _BREAK_ variable in TEMP table*/
......
compute nval;
if missing(_break_) then &timevar=' ';
endcomp;
proc report ...... out=temp /*Check the _BREAK_ variable in TEMP table*/
......
compute nval;
if missing(_break_) then &timevar=' ';
endcomp;
Thank you for your quick response!!
I just wanted to add to your solution that if your &timevar variable is numeric you must add . = ' ' in the predefined format to avoid a point to appear in your final proc report.
Thanks again!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.