Date: Wed, 31 May 2006 13:59:19 -0700
Reply-To: statreport <sasguy1@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: statreport <sasguy1@GMAIL.COM>
Organization: http://groups.google.com
Subject: Proc report and Macro
Content-Type: text/plain; charset="iso-8859-1"
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.
Example
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*/