BookmarkSubscribeRSS Feed
apagote
Calcite | Level 5

Hi Team,

 

I need to change color or make bold to character variable using proc format.

Please find below the code used.


data dsn;
length State County Community $10.;
input State $10.
County $9.
Community $8.
flag 2.
;
datalines;
California Calveras Wallace 1
;
run;


proc format cntlout=colormodel(keep=fmtname start end label type sexcl eexcl);
value $State 'California' = "fontWeight:bold;";
value flag 1 = "";
run;

data colormodel(drop=T);
set colormodel(rename=(TYPE=T));
length TYPE $32;
if FMTNAME eq 'STATE' then TYPE = 'flag';
else TYPE = 't';
run;

 

data colormodel;
format state $state.;
set dsn;
run;

 

Thanks,

Arnav

4 REPLIES 4
andreas_lds
Jade | Level 19

Text decoration is only possible in reporting procedures. There are numerous papers explaning anything relevant in detail.

Reeza
Super User

That's not how proc format works. It acts as a recoding procedure with the rules being the input. 

Style such as colour and font are not valid in a SAS dataset. 

 

So what are you trying to do?

apagote
Calcite | Level 5

Yes I am trying to change Style such as colour and font  in a SAS dataset  to show in a web browser through SAS SNA and this browser is accessing this table and i need to do conditional highlighting

Reeza
Super User

Search on lexjansen.com for papers by Cynthia Zender that show how to create stylish reports.

 

 http://support.sas.com/resources/papers/proceedings13/366-2013.pdf

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
  • 4 replies
  • 2953 views
  • 0 likes
  • 3 in conversation