- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you @ballardw
This works fine and solution is easy.