Date: Fri, 22 May 2009 13:20:48 -0400
Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject: Re: Deleting rows in a data set...help required
...but you won't get out the 12 / 21 rows with that.
Gerhard
On Fri, 22 May 2009 13:10:04 -0400, Nat Wooding
<Nathaniel.Wooding@DOM.COM> wrote:
>Dinesh
>
>Here, we can use the max and min functions and the SAS automatic variable
>_numeric_ which refers to all of the numeric variables in a data set.
>
>Data D;
>input id1 id2 id3 id4 ;
>cards;
> 11 12 22 11
> 22 11 12 12
> 11 11 11 11
> 12 21 12 21
> 11 22 12 12
> 12 21 22 11
> 11 22 22 22
> 22 22 22 22
> 12 21 22 11
> 11 22 11 21
> run;
> Data Wanted;
> set D;
> if max(of _numeric_) = min( of _numeric_) then delete;
>run;
>proc print;
>run;
>
>Nat Wooding
>Environmental Specialist III
>Dominion, Environmental Biology
>4111 Castlewood Rd
>Richmond, VA 23234
>Phone:804-271-5313, Fax: 804-271-2977
>
>
>
> Dinesh
> <mtdinesh@GMAIL.C
> OM> To
> Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU
> Discussion" cc
> <SAS-L@LISTSERV.U
> GA.EDU> Subject
> Deleting rows in a data set...help
> required
> 05/22/2009 12:21
> PM
>
>
> Please respond to
> Dinesh
> <mtdinesh@GMAIL.C
> OM>
>
>
>
>
>
>
>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
>
>
>CONFIDENTIALITY NOTICE: This electronic message contains
>information which may be legally confidential and or privileged and
>does not in any case represent a firm ENERGY COMMODITY bid or offer
>relating thereto which binds the sender without an additional
>express written confirmation to that effect. The information is
>intended solely for the individual or entity named above and access
>by anyone else is unauthorized. If you are not the intended
>recipient, any disclosure, copying, distribution, or use of the
>contents of this information is prohibited and may be unlawful. If
>you have received this electronic transmission in error, please
>reply immediately to the sender that you have received the message
>in error, and delete it. Thank you.
|