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 (September 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 8 Sep 2008 17:17:59 -0500
Reply-To:     "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Subject:      Re: Deleting column based on values in column
Comments: To: Suren gc <gc_suren@yahoo.com>
In-Reply-To:  <200809082024.m88G7psf020980@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1

If you can use a where expression to determine the criteria you can use a data step similar to the following to determin if the variable is to be dropped.

data have; input A B C:$1.; cards; 1 2 a 1 3 b 1 4 c 1 6 d ;;;; run; %let drop = ; data _null_; if _n_ eq 1 and not eof then call symputx('drop','c'); stop; set have(where=(c eq 'c')) end=eof; run; %put NOTE: DROP=**&drop**; data need; set have(drop=&drop); run; On 9/8/08, Suren gc <gc_suren@yahoo.com> wrote: > I have a dataset like this: > A B C > 1 2 a > 1 3 b > 1 4 c > 1 6 d > > Is there a way I can write SAS program where the comparison is made on the > value of the column and manipulation is made to the column. > For instance, if Column C has value c, then deleted the column containing c > rather than deleting the row. > Thanks, > Suren >


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