BookmarkSubscribeRSS Feed
mftuchman
Quartz | Level 8
I am curious about how I can use CELLSTYLE AS statements to style an entire row when one row of an underlying ODS table may corresponding to several rows of physical output.

Consider the following code:

ods output summary=s2;
proc means nway mean std data=sashelp.class;
var height weight age;
class sex;
run;
ods output close;

/* I print this out for reference to see the underlying output table */
proc print data=s2;
run;


1. I want to know if it is possible using ONLY the TEMPLATE procedure, editing the base.summary template, how to highlight the rows containing AGE in the PROC MEANS output.

2. How to color bar the rows of this table, but using _ROW_ expression does not have the desired effect because PROC TEMPLATE sees the input table as having only two rows, not 6.]

Message was edited by: mftuchman
Also, I'm curious about why my
 tags did not work.

Message was edited by: mftuchman Message was edited by: mftuchman
5 REPLIES 5
Cynthia_sas
SAS Super FREQ
Hi:
Not sure about CELLSTYLE...AS because you're right that one row is one row, no matter what's stacked in the one row. I have some CELLSTYLE examples, but not with stacked columns.

As for forum markup, this is a useful post.
http://support.sas.com/forums/thread.jspa?messageID=27609毙

I never tried
 I always use [pre] and [/pre] to delimit code and output snippets.

cynthia
Cynthia_sas
SAS Super FREQ
An afterthought:
You are using ODS OUTPUT as your destination in the code snippet and ODS OUTPUT is a data-centric destination -- it creates a SAS dataset -- and SAS datasets do NOT have style information such as colors and fonts stored in the descriptor portion of the dataset. So, if you -do- implement a change with CELLSTYLE...AS, you must direct your output to a destination which supports style templates (OTHER than OUTPUT such as HTML, RTF or PDF) -- for example -- ODS CSV would NOT support style templates, but ODS HTML would.

cynthia
mftuchman
Quartz | Level 8
> An afterthought:
> You are using ODS OUTPUT as your destination in the
> code snippet and ODS OUTPUT is a data-centric
> destination -- it creates a SAS dataset

That was my intention - to create a data set. Where I go wrong is building a template around this. I am working too hard to duplicate an existing presentation format. Close enough might be good enough.
mftuchman
Quartz | Level 8
Let me start over: Given this code
[pre]
proc means nway mean std data=sashelp.class;
var height weight age;
class sex;
run;
[/pre]

Note that ODS output is GONE.

What can I do to highlight each row (height, weight, age) with a different color. Why might I want this? One department may want to see all variables, just to double check the overall relationship, but only two variables will ultimately be reported. So I might want to highlight those.
Cynthia_sas
SAS Super FREQ
Hi:
What is your destination of choice for the report with the highlighting? Does this have to be done with PROC MEANS or would another procedure work (such as PROC TABULATE or PROC REPORT)??

cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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