|
Hi Mike,
Just a suggestion: can't you analyse the data to be fed into PROC REPORT beforehand in a DATA step to see whether your condition is met and then create a macro variable (CALL SYMPUT) which you subsequently use in a macro with PROC REPORT, where you could execute the LINE statement macro-conditionally (%IF)?
Regards - Jim.
--
. . . . . . . . . . . . . . . .
Jim Groeneveld, MSc.
Biostatistician
Science Team
Vitatron B.V.
Meander 1051
6825 MJ Arnhem
Tel: +31/0 26 376 7365
Fax: +31/0 26 376 7305
Jim.Groeneveld@Vitatron.com
www.vitatron.com
My statistics are quite predictable, but my computer may be quite unpredictable.
[common disclaimer]
-----Original Message-----
From: Mike Rhoads [mailto:RHOADSM1@WESTAT.COM]
Sent: Monday, July 12, 2004 15:53
To: SAS-L@LISTSERV.UGA.EDU
Subject: PROC REPORT - simulating conditional LINE statement
One of our folks had an interesting need in PROC REPORT:
"I have a report that generates about 10 adverse events per visit date, and
at the bottom of each group of records I have a comment line that summarizes
all of the records (e.g. 10 records for January 1 followed by a single gray
comment line, 10 records for February 1 followed by a single gray comment
line, etc.). I would like to produce the comment line only if some
condition is met, but from reviewing the documentation it seems that this is
not possible. Is there an alternate route to take? I'd also like to
potentially generate the comment for a given event within the group of
records if possible."
compute after visdaten / style=[background=grayBB];
line @1 comments $char200.;
endcomp;
Since you can't explicitly have a conditional LINE statement in PROC REPORT,
the best workaround I could come up with was to conditionally control the
contents of the COMMENTS variable, making it blank when the comment was not
desired. Ideally you could also turn off the [background=grayBB], but I
don't see any obvious way to do that.
I guess there is also an issue with the desire "to potentially generate the
comment for a given event within the group of records." According to the
documentation, the LINE statement is only valid in COMPUTE blocks associated
with a location (COMPUTE BEFORE or COMPUTE AFTER). So, to implement a
"comment" for a single event, I guess one would need to add a dummy grouping
variable so that each event could be seen as its own group (?).
Other / better ideas? We are still at 8.2 for production, but have access
to 9.1 if needed.
Thanks!
Mike Rhoads
Westat
RhoadsM1@Westat.com
|