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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of 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
  • 4 replies
  • 3387 views
  • 0 likes
  • 3 in conversation