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 (May 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 4 May 2006 18:18:26 -0700
Reply-To:     Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Subject:      Re: assign single value to broken series of variables
Comments: To: Eash <easwara@GMAIL.COM>
In-Reply-To:  <1147077632.591032.130580@i39g2000cwa.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 5/8/2006 1:40 AM Eash said the following: > Hi All, > > based on a IF rule, Is it possible to assign a single value to a series > of variables(broken)?? > > for eg, I've variables CARD22,CARD34,CARD44,CARD55..etc(note that the > variables are not continuous) > > and with the value of a variable X , i want to do the following! > > If X='BALANCE' Then do; > CCARD22=-99; > CCARD34=-99; > CCARD44=-99; > CCARD55=-99; > .. > .. > .. > End;

David Cassell must be out to lunch (a late lunch). I was expecting him to chime in with "You don't want to do that!"

So why do you want to do that? This seems like a good use for SAS missing values. Assuming that the CCARD variables ordinarily contain meaningful numeric values, it's not a good idea to throw in values from a different domain. Sooner or later someone will try to take a sum or mean of those fields, and that's trouble.

> Of course, I have 50+ CCARD Variables and don't wanna do it with the > help if assignment statements. Even if we go for a MACRO'y solution, I > need to pass the 22,34,44,55 as parameters!!! is there any short cut > (which surely i'm not aware)..to shorten my code ? > > thanks > Easwara >


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