Date: Thu, 10 Jan 2008 10:34:45 -0800
Reply-To: Darryl Putnam <darrylovia@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Darryl Putnam <darrylovia@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: PROC SQL--select DISTINCT
Content-Type: text/plain; charset=ISO-8859-1
On Jan 10, 12:54 pm, t...@MAIL.COM (Tom White) wrote:
> Hello SAS-L
>
> I have a SAS data set with many fields (variables).
>
> Suppose I would like to write sql code like
>
> proc sq;
> create table FOO2 as
> select(distinct VAR1), distinct(VAR2), distinct(VAR3),
> VAR4, VAR5
> from FOO1
> group by VAR1, VAR2, VAR3, VAR4, VAR5;
> quit;
>
> SAS does not recognize the distinct function. In other words,
> I cannot write
>
> .....
> select(distinct VAR1), distinct(VAR2), distinct(VAR3),
> .....
> quit;
>
> Is there any way to select multiple DISTINCT variables like I am attempting to do above?
>
> Thank you.
> T
>
> --
> Are we headed for a recession? Read more on the Money Portal
> Mail.com Money -http://www.mail.com/Money.aspx?cat=money
I assume you want list of the variable values?
Try this
proc summary data=FOO1 missing nway; /* you may or may not want the
nway option, try it both ways */
class VAR1-VAR5
output out=FOO2;
run;
-Darryl
|