DATA Step, Macro, Functions and more

Proc report+ highlight a row only

Reply
Frequent Contributor
Posts: 83

Proc report+ highlight a row only

Hi ,

I have a dataset with a couple of colums

Unfortunately i need to highligh only one row based on the value of the first colum.

Please could somebody suggets a code to do it.

Something like if firstcolum=sales , then highlight the entire row using colors or bold


help would be deeply apprecited
Regular Contributor
Posts: 171

Re: Proc report+ highlight a row only

You need to use a call define statement with the _row_ argument within a compute block. For example:

If _c1_ = ‘sales’ then call define (_row_, ‘style’, ‘style={background=yellow}’);
Super Contributor
Posts: 673

Re: Proc report+ highlight a row only

Try this:
DATA TEST;
LENGTH ID $ 5 NAME $ 10 ADDRESS $ 15;
INPUT ID $ NAME $ ADDRESS $ QTY;
DATALINES;
SALES John Philadephia 25
BUY Adams Tampa 30
SALES Adams Orlando 30
BUY Mark Austin 30
;
RUN;

/* CREATE MACRO VARIABLE WITH ALL DUPLICATE PHYID VALUES */
DATA TEST1;
SET TEST;
IF ID='SALES' THEN FLAG='1';
ELSE FLAG='0';
RUN;

ODS LISTING CLOSE;
ODS HTML FILE='C:\Documents and Settings\Desktop\test.xls';

PROC REPORT DATA=TEST1 NOWINDOWS;
COLUMNS ID NAME ADDRESS QTY FLAG;
DEFINE FLAG/NOPRINT;
COMPUTE flag;
IF FLAG='1' THEN CALL DEFINE(_ROW_, "STYLE", "STYLE=[BACKGROUND=blue]");
ENDCOMP;
RUN;
ODS HTML CLOSE;
ODS LISTING;
Ask a Question
Discussion stats
  • 2 replies
  • 133 views
  • 0 likes
  • 3 in conversation