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 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 21 Dec 2004 14:48:18 -0500
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: Easy proc FREQ question (SPARSE related, I think)
Content-Type:   text/plain; charset="us-ascii"

> From: Anneke Gr > I have a very basic proc FREQ question. > > I use proc freq to determine the number of cases of say males > and females in my dataset. I need to output both males and > females in my output dataset. Unfortunately I have only > females in the dataset. It looks like SPARSE is what I am > looking for, but that only works with n>1 tables and I only > want to output gender. I do not want to crosstabulate gender > with anything. > The gender variable has a format on it to indicate male and female. > > Any way to do this????

I see some others have suggested solutions.

if I read your question right you want your output data set to have rows for each of the labels of the format.

none of the options of Proc Freq will report more than what is in the data set.

for v9 you may wish to examine the preloadformat option: preloadfmt Andy Karp has an excellent paper on using this with some procedure 240-29

and, of course, I have a macro which will glue together the format and freq output

send e-mail with subject: request FreqXtab

check our most excellent archives: http://www.listserv.uga.edu/archives/sas-l.html search for: preloadfmt substring search: [X] subject contains: author's address: since: Jan 2000 until:

Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov

see also SUGI Proceedings: http://www.lexjansen.com/sugi/ search for preloadfmt

FAQ: How to use SAS-L http://www2.sas.com/proceedings/sugi29/247-29.pdf


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