LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (February 2011, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Charlie Huang <charlie.chao.huang@GMAIL.COM>
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


Back to: Top of message | Previous page | Main SAS-L page