BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
emera86
Quartz | Level 8

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:

 

tablebreak.png

 

Thank you for your help!!

 

Best regards

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

proc report ...... out=temp  /*Check the _BREAK_ variable in TEMP table*/

......

compute nval;

 if missing(_break_) then &timevar='  ';

endcomp;

View solution in original post

2 REPLIES 2
Ksharp
Super User

proc report ...... out=temp  /*Check the _BREAK_ variable in TEMP table*/

......

compute nval;

 if missing(_break_) then &timevar='  ';

endcomp;

emera86
Quartz | Level 8

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!

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1106 views
  • 0 likes
  • 2 in conversation