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!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.