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:         Mon, 8 May 2006 17:22:04 -0700
Reply-To:     David L Cassell <davidlcassell@MSN.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         David L Cassell <davidlcassell@MSN.COM>
Subject:      Re: assign single value to broken series of variables
In-Reply-To:  <200605081225.k48AkRpM002388@mailgw.cc.uga.edu>
Content-Type: text/plain; format=flowed

On Mon, 8 May 2006 01:40:32 -0700, Eash <easwara@GMAIL.COM> wrote: > >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; > > > >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

I would say that you DO NOT want to do this. Saving numeric data as -99 went out with 1980's style COBOL. It's a bad idea, since the slightest mistake on the part of other anlaysts will leave those -99's in thre, and ruin the data analysis.

Use SAS missing values instead.

And, since you have nto explained what your CCARDxx vlaues are used for, I have a suspicion that your database structure may also be a problem. It certainly is enough of a problem that you are having to grapple with additional features of SAS...

HTH, David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330

_________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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