Date: Tue, 21 Mar 2000 13:31:12 -0800
Reply-To: Ya Huang <ya.huang@AGOURON.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ya Huang <ya.huang@AGOURON.COM>
Subject: Re: create report in row
Content-Type: text/plain; charset=us-ascii
Here is one solutions:
** testing data;
data xx;
do i=1 to 10;
a=uniform(i)>0.5;
b=uniform(i*999)>0.5;
output;
end;
data xx;
set xx (keep=a rename=(a=v) in=a)
xx (keep=b rename=(b=v) in=b);
if a then ab='a';
if b then ab='b';
dummy=1;
options nocenter;
proc tabulate;
class ab v;
var dummy;
table ab='', v*dummy=''*sum=''*f=6.;
run;
=======
:-------------------------------.-------------:
| | V |
| !------.------|
| | 0 | 1 |
!-------------------------------+------+------|
|a | 4| 6|
!-------------------------------+------+------|
|b | 5| 5|
;-------------------------------^------^------!
HTH
Ya Huang
Daniella Priscila Cruz - Estagiaria SAS wrote:
> Dear list,
>
> I would like to know how I can to do a report in row.
> Example:
> In my data I have 2 variables A and B, this variable has 0 and 1.
> A B
> ___________
> 1 0
> 0 1
> 1 0
> ______________________________________
> Result that I want :
> 0 1
> A 1 2
> B 2 1
> ______________________________________
>
> I used proc tabulate, but the result is
>
> A B
> 0 1 0 1
> 1 2 2 1
> ______________________________________
>
> Thanks, Daniella Cruz