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 (July 2003, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 21 Jul 2003 17:02:49 -0400
Reply-To:     "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Subject:      Re: Help with Freq..
Comments: cc: Nagakumar Sridhar <nsridhar@ATHEROGENICS.COM>
Content-Type: text/plain

> From: Nagakumar Sridhar [mailto:nsridhar@ATHEROGENICS.COM] > I need some help with the Proc freq procedure. I > merged 2 datasets (both containing data with sex='Female' > only) into a new dataset (xyz). When I do a proc freq on > dataset xyz, I need to have the count for male (although = 0) > displayed. Right now, it displays only the female count.

sparse is the FREQ tables option that you want

proc FREQ data = LIBRARY.WHATEVER; tables varlist / list missing noprint sparse out = WORK.FREQ

YeahBut sparse will pad your output in cross-tabs when there are no instances in that level.

if the data contains no instances of sex=Male then sparse is useless and you'll have to add a row in a data step.

data FREQ; set FREQ end = EndoFile; if EndoFile then do;Sex=Male;output;end;stop;

Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov

remember perspective: the error is not always where it seems to occur! -- RJF2


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