Date: Fri, 18 Jul 2003 04:32:06 -0400
Reply-To: "Michael L. Davis" <michael@BASSETTCONSULTING.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Michael L. Davis" <michael@BASSETTCONSULTING.COM>
Subject: Re: PROC REPORT - display COMPUTE lines only
Content-Type: text/plain; charset="us-ascii"; format=flowed
I want to thank Andre Wielki, Richard Read Allen, and Jack Hamilton for
responding to my question. The approach that I took was to summarize the
data with a data step and then use PROC REPORT to handle the display. It
was *not* necessary to visit PROC TEMPLATE for this exercise.
I had mentioned in my original post that the rows had different formats
(percents, counts, and dollar sums). So it was necessary to build separate
accumulators in the data step and to pass the summaries to PROC REPORT as
right-aligned character strings.
Some of the posts to SAS-L had suggested using PROC TEMPLATE to suppress
the output that I didn't want. There are some problems with that
approach. First, when I used the ODS TRACE ON feature, the SAS Log
appeared to tell me that the table and summary were part of the same ODS
object. So you cannot have one without the other.
Worse, my understanding is that PROC REPORT is a member of the "Gnarly
Four" procedures (PRINT, REPORT, TABULATE, and FREQ) that do not use table
templates. So I am not sure that the PROC TEMPLATE alternative is really
available anyway. You can use the STYLE= option to change the appearance
of the output from these procedures.
- Michael "Mad Doggy" Davis
At 09:57 AM 7/18/2003 +0200, "WIELKI Andre" <email@example.com> wrote:
>In his answer Jack Hamilton was thinking a solution with proc template
>But proc report is just one of the procedure where template style
>does not apply and where the output table object is not capturizable
>perhaps it would work if you take another way : proc summary or data step
>with the compute operations
>and working after upon a table template and ods output?
>At 14:01 11/07/2003 -0400, you wrote:
>>I thought that I would visit the "L" with the following question because
>>SAS-L is great for suggesting more productive directions as well as for
>>solving technical issues:
>>At the bottom of my message is a piece of PROC REPORT code. All of the
>>variables have been assigned the NOPRINT attribute. All that one sees is
>>the summary from the COMPUTE AFTER block (and some blank lines -- more
>>later). The data is from the SASHELP sample table, class.
>>Your next question is, why would the Mad Doggy be pursuing this? My
>>1. Avoid data _null_ coding
>>2. Take advantage of ODS features
>>The ultimate report would have several summary lines, with different
>>variables and layouts for each line. So PROC PRINT would not be a good
>>choice unless I did some data step preprocessing.
>>The example "sort of works". The summary is correct but there are several
>>blank lines before the summary. So my approach is not ready for prime time
>>So, given 1. and 2., what alternatives might I pursue? Can PROC REPORT be
>>tricked into doing my bidding? Are there other ways to get this kind of
>>summarization done through a procedure in Version 8 that will also allow me
>>to take advantage of ODS?
>>Thanks in advance for any suggestions.
>>- Michael "Mad Doggy" Davis
>>data test ;
>> set sashelp.class ;
>> dummy= ' ' ;
>>proc report data=test nowd missing ps=20;
>> column dummy sex age height weight
>> define dummy / '
>> define sex / group
>> define age / group
>> define height / analysis
>> define weight / analysis noprint
>> if _break_ eq ' ' and height.sum gt 60 then hold1+1
>> if _break_ eq ' ' and weight.sum gt 100 then hold2+1
>> compute after ;
>> line 70*'-' ;
>> line 'Over 60 inches '
>> hold1 8.0
>> ' Over 100 pounds '
>> hold2 8.0 ;
>> line 70*'-' ;
>> endcomp ;
>>Michael L. Davis
>>Bassett Consulting Services, Inc.
>>10 Pleasant Drive
>>North Haven CT 06473-3712
>INED - Service Informatique
>133 Bd Davout,
>75 980 Paris Cedex 20
>Tel: 01 56 06 21 54
Michael L. Davis
Bassett Consulting Services, Inc.
10 Pleasant Drive
North Haven CT 06473-3712