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 (May 2006, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 31 May 2006 21:09:57 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: Proc report and Macro
Comments: To: sasguy1@GMAIL.COM
In-Reply-To:  <>
Content-Type: text/plain; format=flowed

StatReport ,

Drop the macro business, use by group processing and say #Byval1 in your title statement, then set variable Study in the proc report as a grouping varibale.

Toby Dunn

From: statreport <sasguy1@GMAIL.COM> Reply-To: statreport <sasguy1@GMAIL.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Proc report and Macro Date: Wed, 31 May 2006 13:59:19 -0700

Hello everybody,

I have one dataset which contains around 1200 observations which is integrated summary. The dataset has observations from 6 different studies. The total number of treatments are 14. Although each study does not contain 14 different treatments. Say study1 has 6 treatments, study2 has 7 treatments, study3 has 4 treatments.......but the unique treatments are 14. The task is to produce listings of this dataset. But the listings are needed according to study and treatment. This study and treatment should appear as title and not as variable.


Study1 Treatment1 (Respective observations)

Study1 Treatment 2 (Respective observations)

I have written macro which will take this whole dataset and will use PROC REPORT which will give me the variables I want in the listing. But whenever I place a macro call. The most recent proc report output overwrites the previous one.

Does anybody have any idea which will help me to get not only the output of last macrocall but output from all macrocalls.

my code is as follows:

%macro report(study=, trt=); proc report data=CCCC.ddddd nowd headline headskip nocenter; column a b c d e f g h i j; define a/flow width=30 center 'XXXXXXXXXXXX'; define b/flow width=10 center 'vvvvvvvvv' ; define c/flow width=10 center 'zzzzzzzz'; define d/flow width=20 center 'dfhdjhfdhfjdhfjdjfhdjfhdjf'; define e/flow width=20 center 'fdhfdjfhdjhfjdhjhfudfu'; define f/flow width=8 center 'rreeeeeee'; define gflow width=10 center 'Outcdfgdhfgdhf'; define h/flow width=10 center 'fftdtfdftdtfdtf'; define i/flow width=15 center; define j/flow width=10 center ; define k/flow width=10 center; title1 "Listing 1: All Adverse Events"; title2 " "; title3 "variables:"; title4 "study=&study, Treatment=&trt"; /* Here in this title I want study=A, treatment=1 and those observations follow then study=A, treatment=2 etc etc*/ run; %mend report; %report(study='A',trt='1') %report(study='A',trt='2') /* Many Other Macrocalls will follow*/

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