LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 10 Dec 2007 11:50:24 -0600
Reply-To:     Yu Zhang <zhangyu05@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Yu Zhang <zhangyu05@GMAIL.COM>
Subject:      Re: Proc Tabulate
In-Reply-To:  <445d9dbe0712100916s3c73b4faw9d56f05217f4dd8@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

* hello, Actualy, we don't need to create an extra dataset. if we assign 1 to a variable for each record, then specify it as denominator in PCTSUM. it will do the job.

HTH

Yu

data* new;

retain ind *1*;

infile datalines dsd;

input result $ system $;

if result='normal' then r1=*.*;

else r1=*1*;

datalines;

normal,cardio

normal,cardio

normal,cardio

normal,cardio

normal,gastro

normal,gastro

normal,neuro

normal,neuro

normal,neuro

normal,neuro

normal,skin

normal,skin

normal,skin

normal,feet

abnormal,cardio

abnormal,gastro

abnormal,gastro

abnormal,gastro

abnormal,neuro

abnormal,resp

abnormal,resp

abnormal,resp

abnormal,resp

abnormal,resp

abnormal,skin

abnormal,skin

abnormal,feet

abnormal,feet

; *

run*; *

proc* *tabulate* data=new;

class system;

var r1 ind;

table system,r1=''*(sum='N' pctsum<ind>='%') ;

*run*;

On Dec 10, 2007 11:16 AM, Yu Zhang <zhangyu05@gmail.com> wrote:

> Learned this trick from Howard a while ago and took me almost a hour to > recall how it works. I took the sample data created by TreeFrog. Thank you > Tree frog!!! None of works is done by me. > > So here it goes: > >


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