The SAS Output Delivery System and reporting techniques

ODS CELLSTYLE as with Generic/Stacked templates

Reply
Contributor
Posts: 42

ODS CELLSTYLE as with Generic/Stacked templates

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

Re: ODS CELLSTYLE as with Generic/Stacked templates

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

Re: ODS CELLSTYLE as with Generic/Stacked templates

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

Re: ODS CELLSTYLE as with Generic/Stacked templates

> 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.
Contributor
Posts: 42

Re: ODS CELLSTYLE as with Generic/Stacked templates

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

Re: ODS CELLSTYLE as with Generic/Stacked templates

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
Ask a Question
Discussion stats
  • 5 replies
  • 370 views
  • 0 likes
  • 2 in conversation