Date: Tue, 31 Jul 2007 14:09:39 -0700
Reply-To: "Pardee, Roy" <pardee.r@GHC.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Pardee, Roy" <pardee.r@GHC.ORG>
Subject: Re: SQL
In-Reply-To: A<9b5abea60707311301i28e5b969q3bc28f785e7ee64e@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"
Can you explain the SQL requirement? This is such a natural for
datastep... Something like:
Data want ;
set have ;
by var1 var2 ;
MyKey + first.var2 ;
Run ;
Would do it I think...
Cheers,
-Roy
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
souga soga
Sent: Tuesday, July 31, 2007 1:01 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: SQL
Hi,
I have a data set :
Var1 Var2
A 2
A 1
B 2
B 2
C 5
D 1
R 7
R 7
I would like to the output to look like this:
MyKey Var1 Var2
1 A 2
2 A 1
3 B 2
3 B 2
4 C 5
5 D 1
6 R 7
6 R 7
i.e i would like to create a counter (MyKey variable) which identifies
the uniques and duplicates in this manner.
I need this to be done using PROC SQL .
Thanks,
Sa
|