Date: Fri, 25 Feb 2011 11:28:48 -0500
Reply-To: Suzanne McCoy <Suzanne.McCoy@CATALINAMARKETING.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Suzanne McCoy <Suzanne.McCoy@CATALINAMARKETING.COM>
Subject: Re: By statement in Proc Report
In-Reply-To: <AANLkTikNRgRb6hj+ix5RemYjhnPTYguwW+5n8Sz+PaR4@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"
Look at the order= option on the proc report statement
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Charlie Huang
Sent: Friday, February 25, 2011 10:15 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: By statement in Proc Report
Hi,
In Proc Format, if I use by statement, I will have such results:
proc sort data=sashelp.class out=one;
by sex;
run;
proc report data=one nowd;
by sex;
columns age n;
define age/group;
run;
-- Sex=F -----------
Age n
11 1
12 2
13 2
14 2
15 2
-- Sex=M -----------
Age n
11 1
12 3
13 1
14 2
15 2
16 1
If I want to have a uniformized table format for both gender and my desired result is like below, any way in Proc Report can do it? Many thanks.
-- Sex=F -----------
Age n
11 1
12 2
13 2
14 2
15 2
16 0
-- Sex=M -----------
Age n
11 1
12 3
13 1
14 2
15 2
16 1