ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
nieminek
Calcite | Level 5

Hi

I would like to highlight rows in a table output using  proc tabulate but only get this error messages  "ERROR: Format references are not allowed:"

This is how I programmed my test: 

1. at first create format for specific colors

 

proc format lib=work;
value temp

1=red
2=purple
3=orange
4=pink
6=yellow
other=blue;
run;

 

2. then apply this format in ODS/proc tabulate statement :

 

ods excel file=....;

proc tabulate data=_input_data order=data S=[foreground=black];
class x / style={background=temp.};
class y/ style=<parent>;
var _some_variable;

table x*y,_some_variable;

run;

ods excel close;

 

x-variable contains values such as 1,2,3,4

y-variable contains classification values such as '01','02',.....'05.4.3'

 

 

3. Now I'm expecting to get x and y highlighted based on the values in x

No success, only above mentioned error-message. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

If the values you want to highlight are the row or column headers for a CLASS variable that would go into a CLASSLEV statement.

 

Since the format you show is only for numeric variables I have to assume it applies to your X variable.

proc tabulate data=_input_data order=data S=[foreground=black];
class x y; classlev x / style={background=temp.}; classlev y/ style=<parent>; var _some_variable; table x*y,_some_variable; run;

But you may need to provide some data and more details of what you actually want the appearance to look like

View solution in original post

2 REPLIES 2
ballardw
Super User

If the values you want to highlight are the row or column headers for a CLASS variable that would go into a CLASSLEV statement.

 

Since the format you show is only for numeric variables I have to assume it applies to your X variable.

proc tabulate data=_input_data order=data S=[foreground=black];
class x y; classlev x / style={background=temp.}; classlev y/ style=<parent>; var _some_variable; table x*y,_some_variable; run;

But you may need to provide some data and more details of what you actually want the appearance to look like

nieminek
Calcite | Level 5

Thank you @ballardw 

This works fine and solution is easy. 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 2 replies
  • 884 views
  • 0 likes
  • 2 in conversation