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 14:38:41 -0600
Reply-To:     Paul.Bartells@TXU.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Paul Bartells <Paul.Bartells@TXU.COM>
Subject:      Re: Multiple variables quesiton
Comments: To: Nathaniel.Wooding@dom.com
In-Reply-To:  <OF301FCA28.B57462FD-ON8525738E.00710822-8525738E.007113B8@dom.com>
Content-Type: text/plain; charset="us-ascii"

Sorry, I mis-read the problem. My suggestion was, of course, geared for dropping entire rows if all variables were zero. Not quite the same thing.

Paul Bartells

TXU Energy | Dallas, TX

-----Original Message----- From: Nathaniel.Wooding@dom.com [mailto:Nathaniel.Wooding@dom.com] Sent: Friday, November 09, 2007 2:35 PM To: Bartells, Paul Subject: Re: Multiple variables quesiton

Except as I read his question, he wants to drop columns.

Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977

Paul Bartells

<Paul.Bartells@TX

U.COM> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU

Discussion" cc <SAS-L@LISTSERV.U

GA.EDU> Subject Re: Multiple variables quesiton

11/09/2007 03:29

PM

Please respond to

Paul.Bartells@TXU

.COM

Or, depending on how the variables are named, it could be as simple as

Rowtot = sum of (var1 - var200); If not rowtot then delete;

Paul Bartells TXU Energy Dallas, TX

Hi Art: Or something like this would do it too:

data have; input a b c d e; cards; 1 0 2 0 0 0 0 0 0 0 2 0 0 1 0 3 0 0 0 0 ;

data need; set have; if min(of a--e) + max(of a--e) ne 0; run;

proc print; run;

HTH

Kumar

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Arthur Tabachneck Sent: Friday, November 09, 2007 2:39 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Multiple variables quesiton

Mike,

I don't know if this is any easier than Paige's suggestion, but it avoids having to deal with the nuances of macro variables:

data have; input a b c d e; cards; 1 0 2 0 0 0 0 0 0 0 2 0 0 1 0 3 0 0 0 0 ;

proc transpose data=have out=temp1; run;

data temp2; set temp1; if min(of col1-col4) + max(of col1-col4) ne 0; run;

proc transpose data=temp2 out=want (drop=_:); run;

HTH, Art --------- On Fri, 9 Nov 2007 10:19:59 -0800, mholmes@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. > >Mike

Confidentiality Notice: This email message, including any attachments, contains or may contain confidential information intended only for the addressee. If you are not an intended recipient of this message, be advised that any reading, dissemination, forwarding, printing, copying or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by reply message and delete this email message and any attachments from your system.

----------------------------------------- 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.

Confidentiality Notice: This email message, including any attachments, contains or may contain confidential information intended only for the addressee. If you are not an intended recipient of this message, be advised that any reading, dissemination, forwarding, printing, copying or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by reply message and delete this email message and any attachments from your system.


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