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 (November 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 9 Nov 2007 10:47:16 -0800
Reply-To:   Paige Miller <paige.miller@KODAK.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Paige Miller <paige.miller@KODAK.COM>
Organization:   http://groups.google.com
Subject:   Re: Multiple variables quesiton
Comments:   To: sas-l@uga.edu
In-Reply-To:   <1194632399.046356.78290@s15g2000prm.googlegroups.com>
Content-Type:   text/plain; charset="us-ascii"

On Nov 9, 1:19 pm, mhol...@cuesta.edu wrote: > Hello all, > I am working with a dataset with ~200 variables and ~100 > observations each. Most of the data are zeros. Is there a way to > delete all of the variables that have all zero values? The If/then > only seems to work for individual variables. Thanks.

You can do this by writing a macro. It goes something like this: run PROC MEANS and find all those variables that have both minimum and maximum value equal to zero. Make a macro variable containing the list of those variables, and then use that macro variable in a DELETE statement in a data step.

I wish there was a simpler way, but I cannot think of one.

-- Paige Miller paige\dot\miller \at\ kodak\dot\com


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