Date: Thu, 28 May 2009 09:31:50 -0400
Reply-To: Søren Lassen <s.lassen@POST.TELE.DK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Søren Lassen <s.lassen@POST.TELE.DK>
Subject: Re: Deleting rows in a data set...help required
Content-Type: text/plain; charset=ISO-8859-1
Dinu,
Assuming your IDs are character variables:
data want;
set have;
array _ID id1-id<number>;
do _N_=2 to dim(_ID);
if verify(id1,_ID(_N_)) or verify(_ID(_N_),id1) then do;
output;
leave;
end;
end;
run;
In other words - look for a variable not consisting of the exact
same characters as the first ID.
Regards,
Søren
On Fri, 22 May 2009 09:21:34 -0700, Dinesh <mtdinesh@GMAIL.COM> wrote:
>Dear All,
>
>I have some problems with my analysis..
>
>I have a data set with around 2000 columns and 50000 rows....
>
>the dataset appears like this...
>
> id1 id2 id3 id4---------
>1 11 12 22 11
>2 22 11 12 12
>3 11 11 11 11
>4 12 21 12 21
>5 11 22 12 12
>6 12 21 22 11
>7 11 22 22 22
>8 22 22 22 22
>9 12 21 22 11
>10 11 22 11 21
>-
>-
>-
>-
>
>Now..what i need is that, if a particular row contain same values
>throughout the 2000 columns i want to delete it.
>So if a row contains all 11 or all 22 or all 12 or all 21 it should be
>deleted... also 12 and 21 are same and if a row contains only 12 and
>21 it can also be deleted...
>
>so the final output will appear like
>
> id1 id2 id3 id4------
>1 11 12 22 11
>2 22 11 12 12
>5 11 22 12 12
>6 12 21 22 11
>7 11 22 22 22
>9 12 21 22 11
>10 11 22 11 21
>-
>-
>-
>-
>
>rows 3 , 4 and 8 should be deleted...
>
>
>Please help me to solve this
>
>Thanks
>
>Dinu
|