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

Hi Everyone,

 

This code below paint each line a color.

I use N=_N_ to keep track of the row.

Clearly, I don't want to print this column N in my report.

Is there any way to do it?

 

Thank you,

 

HHCFX

 

data have;
input name $ v1 v2 v3;
datalines;
a 1 2 1
a 3 4 0
b 4 5 0
b 3 5 0
b 1 1 1
c 1 1 0
c 0 0 1
;run;

data have; set have; 
N=_N_;run;

proc report data=have nowd;

	define name/display;
	define v1/display;
	define v2/display;
	define v3/display;
	define N/display;

	compute N  ;
		IF N=1 then call define(_row_,'style','style={background=VLIGB}'); ELSE
		IF N=2 then call define(_row_,'style','style={background=LIGGR}'); ELSE
		IF N=3 then call define(_row_,'style','style={background=TAN}'); ELSE
		IF N=4 then call define(_row_,'style','style={background=WHITE}'); ELSE
		IF N=5 then call define(_row_,'style','style={background=VLIGB}'); ELSE
		IF N=6 then call define(_row_,'style','style={background=LIGGR}'); ELSE
		IF N=7 then call define(_row_,'style','style={background=TAN}'); 
	endcomp;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
hhchenfx
Rhodochrosite | Level 12

define N/order noprint;

View solution in original post

1 REPLY 1
hhchenfx
Rhodochrosite | Level 12

define N/order noprint;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 680 views
  • 0 likes
  • 1 in conversation