Date: Fri, 9 Oct 2009 06:36:40 -0500
Reply-To: "Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: Help needed with a report
In-Reply-To: <200910091103.n99Allta028862@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
I don't know TABULATE very well, I use PROC REPORT most of the time.
Tabulate also has PRELOADFMT option.
data test;
infile cards missover;
input Month Patient (Before After)(:$1.);
cards;
01 1 A B
02
03 3 C B
03 4 D E
05
06 5 D E
;;;;
run;
proc format;
value mnth 1=1 2=2 3=3 4=4 5=5 6=6;
value $ba 'A'='A' 'B'='B' 'C'='C' 'D'='D';
run;
proc report nowd headline list data=test completecols completerows;
columns before after (patient,month);
define before / group preloadfmt;
define after / group preloadfmt;
define month / across preloadfmt 'Month' '--';
define patient / n ' ' width=2 format=f2.;
format month mnth. before after $ba.;
break before before / skip;
run;
On 10/9/09, Martino <martino123@hotmail.co.uk> wrote:
> Hi I am having difficulty with a report I am trying to create.
>
> The structure of the data set is as follows:
>
> Month Patient Before After
>
> 01 1 A B
> 02
> 03 3 C B
> 03 4 D E
> 05
> 06 5 D E
>
>
> I need the months to go across the top of the report. Each month must be
> reported EVEN if it has no data.
> Then for every Before-After combination report the number of patients in
> that month.
>
> Simple using Proc Tabulate except that
>
> 1) if I use the MISSING option then I get a row for the blank Before-After
> combination with a 1 for each month where there no Before-After combination.
> 2) If I DON'T use the MISSING option, then months that dont have a BEFORE-
> AFTER combination are not reported.
>
> Hope that rather convoluted explanation is clear and thanks in advance
>
|