Help using Base SAS procedures

PROC TABULATE formats by class level

Reply
Contributor
Posts: 71

PROC TABULATE formats by class level

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!
Valued Guide
Posts: 2,174

Re: PROC TABULATE formats by class level

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
SAS Super FREQ
Posts: 8,740

Re: PROC TABULATE formats by class level

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
Contributor
Posts: 71

Re: PROC TABULATE formats by class level

Thank you! it worked...
Contributor
Posts: 71

Re: PROC TABULATE formats by class level

Thank you Peter and Cynthia! Your solution fixed my problem.
Ask a Question
Discussion stats
  • 4 replies
  • 140 views
  • 0 likes
  • 3 in conversation