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 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 18 Jul 2007 09:57:08 -0400
Reply-To:     "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject:      Re: List distinct values in a character variable

On Wed, 18 Jul 2007 06:20:09 -0700, lavanya <lavenskey@GMAIL.COM> wrote:

>Hi all, > >can u pls help me to list distinct value in a character variable. > >If in a dataset, > all distinct values for each variable should be listed >either as output or as table >using macro > > >Many thanks in advance, > >Warm regards, >Lavenskey

Try this:

proc means data=sashelp.class(keep = _character_); class _all_; ways 1; run;

Results:

N Sex Obs ---------- F 9

M 10 ----------

N Name Obs --------------- Alfred 1

Alice 1

Barbara 1

Carol 1

Henry 1

James 1

Jane 1

Janet 1

Jeffrey 1

John 1

Joyce 1

Judy 1

Louise 1

Mary 1

Philip 1

Robert 1

Ronald 1

Thomas 1

William 1 ---------------


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