LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 13 Jul 2004 08:51:40 +0200
Reply-To:   "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Subject:   Re: PROC REPORT - simulating conditional LINE statement
Comments:   To: Mike Rhoads <RHOADSM1@WESTAT.COM>
Content-Type:   text/plain; charset="iso-8859-1"

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


Back to: Top of message | Previous page | Main SAS-L page