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
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.
infile cards missover;
input Month Patient (Before After)(:$1.);
01 1 A B
03 3 C B
03 4 D E
06 5 D E
value mnth 1=1 2=2 3=3 4=4 5=5 6=6;
value $ba 'A'='A' 'B'='B' 'C'='C' 'D'='D';
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;
On 10/9/09, Martino <firstname.lastname@example.org> 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
> 03 3 C B
> 03 4 D E
> 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