The SAS Output Delivery System and reporting techniques

What is preventing the row highlighting from appearing?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

What is preventing the row highlighting from appearing?

SAS Community,

 

I have seen several good examples of PROC REPORT row highlighting when two colums have certain values but I can't seem to get it to work with my simple dataset.

 

PT1 SOP1 Count

11161,090
11BL160
11CI68
11MA1,282
12BL295
12CI348
12MA6,821
12MB76
21BL32
21CI54
21HM5,208

 

Columns Properties

Column Name  Type  Length  Format  Informat

PT1                  Text   5            $5.        $5.

SOP1               Text   2            $2.

 

I want to highlight the last row, PT1 = '21' and SOP='HM'.

 

Here is excerpt from my PROC REPORT code;

ODS listing close;

options orientation=landscape;

ods html file='d:\temp\demo_3_1.html' style=sasweb;

proc report data=paysrc.SW_freq_FACbyPTbyCFI_&clm._&yr. nowindows headline headskip split='*' style(header)=[fontsize=1] style(report)=[bordercolor = black] style(report)=[fontsize=-1] ;

options number nonumber nodate center;

BY facility;

columns PT1 SOP1 COUNT;

define PT1 / display 'Payment*Topology 1' style(column)=[fontsize=1];

define SOP1 / display 'Claim Filing*Indicator 1' style(column)=[fontsize=1];

define COUNT / display 'Frequency*Count' format=comma10. style(column)=[fontsize=1];

compute PT1;

if PT1 = '21' AND SOP1 = 'HM' then do;

call define (_row_,'style','style={background=cx9999cc}');

end;

endcomp;

 

TITLES;

FOOTNOTES;

RUN;

 

ods html close;

ODS listing;

 

If anyone has any ideas on what I can try next, I would appreciate hearing from you.

Stephen


Accepted Solutions
Solution
‎12-21-2015 12:23 PM
Super User
Posts: 17,835

Re: What is preventing the row highlighting from appearing?

[ Edited ]

I think it's an order of operations issues. 

It applies the background color but then moving on to SOP1 it resets it back to the original. Using SOP1 in your compute statement removes this issue.

 

compute SOP1;
if PT1 = 21 AND SOP1 = 'HM' then 
call define(_row_,"style","style={background=cx9999cc}");
endcomp;

 Full working code:

 



data have;
input pt1 sop1 $ count;
cards;
11 16 1090
11 BL 160
11 CI 68
11 MA 1282
12 BL 295
12 CI 348
12 MA 6821
12 MB 76
21 BL 32
21 CI 54
21 HM 5208
;
run;
proc print; run;



ODS listing close;
options orientation=landscape;
ods html file='c:\_localdata\demo_3_1.html' style=sasweb;
proc report data=have nowindows headline headskip split='*' style(header)=[fontsize=1] style(report)=[bordercolor = black] style(report)=[fontsize=-1] ;
options number nonumber nodate center;
columns PT1 SOP1 COUNT;
define PT1 / display 'Payment*Topology 1' style(column)=[fontsize=1];
define SOP1 / display 'Claim Filing*Indicator 1' style(column)=[fontsize=1];
define COUNT / display 'Frequency*Count' format=comma10. style(column)=[fontsize=1];
compute SOP1;
if PT1 = 21 AND SOP1 = 'HM' then
call define(_row_,"style","style={background=cx9999cc}");
endcomp;

RUN;quit;

ods html close;
ODS listing;

 

View solution in original post


All Replies
Solution
‎12-21-2015 12:23 PM
Super User
Posts: 17,835

Re: What is preventing the row highlighting from appearing?

[ Edited ]

I think it's an order of operations issues. 

It applies the background color but then moving on to SOP1 it resets it back to the original. Using SOP1 in your compute statement removes this issue.

 

compute SOP1;
if PT1 = 21 AND SOP1 = 'HM' then 
call define(_row_,"style","style={background=cx9999cc}");
endcomp;

 Full working code:

 



data have;
input pt1 sop1 $ count;
cards;
11 16 1090
11 BL 160
11 CI 68
11 MA 1282
12 BL 295
12 CI 348
12 MA 6821
12 MB 76
21 BL 32
21 CI 54
21 HM 5208
;
run;
proc print; run;



ODS listing close;
options orientation=landscape;
ods html file='c:\_localdata\demo_3_1.html' style=sasweb;
proc report data=have nowindows headline headskip split='*' style(header)=[fontsize=1] style(report)=[bordercolor = black] style(report)=[fontsize=-1] ;
options number nonumber nodate center;
columns PT1 SOP1 COUNT;
define PT1 / display 'Payment*Topology 1' style(column)=[fontsize=1];
define SOP1 / display 'Claim Filing*Indicator 1' style(column)=[fontsize=1];
define COUNT / display 'Frequency*Count' format=comma10. style(column)=[fontsize=1];
compute SOP1;
if PT1 = 21 AND SOP1 = 'HM' then
call define(_row_,"style","style={background=cx9999cc}");
endcomp;

RUN;quit;

ods html close;
ODS listing;

 

Occasional Contributor
Posts: 13

Re: What is preventing the row highlighting from appearing?

Thank you very much!
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 357 views
  • 1 like
  • 2 in conversation