BookmarkSubscribeRSS Feed
PTD_SAS
Obsidian | Level 7
Could anyone suggest a way to specify different formats and/or ODS output styles for different levels of a class variable in Proc Tabulate?
This is different to defining formats for a specific class variable, I'm looking for a way to have different colours or fonts for a specific level within a class variable. Thanks!
4 REPLIES 4
Peter_C
Rhodochrosite | Level 12
traffic-lighting might help.
search the ods reporting forum and the base SAS Focus area at http://support.sas.com/rnd/base/ods/index.html
Cynthia_sas
SAS Super FREQ
Hi:
Peter is correct. You will use a form of trafficlighting....and you will need the CLASSLEV statement. The only purpose of the CLASSLEV statement is to allow you to specify style for the levels of class variables. So, if you did this:
[pre]
class jobcode / style={background=pink};
classlev jobcode / style={background=cyan};
[/pre]

Then the HEADER cell for JOBCODE would have a background of PINK, but the levels of JOBCODE (such as Job1, Job2, Job3) -- would all have a background color of CYAN.

But, if you have a user-defined format like this:
[pre]
proc format;
value $jc 'Job1' = 'yellow'
'Job2' = 'green'
'Job3'='purple';
run;
[/pre]

Then you can alter the style for levels of JOBCODE by applying the user-defined format:
[pre]
classlev jobcode / style={background=$jc.};
[/pre]

cynthia
PTD_SAS
Obsidian | Level 7
Thank you! it worked...
PTD_SAS
Obsidian | Level 7
Thank you Peter and Cynthia! Your solution fixed my problem.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 832 views
  • 0 likes
  • 3 in conversation