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 (April 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 21 Apr 2006 23:37:18 -0400
Reply-To:   "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject:   Re: Proc Format : Alpha Numeric????
Content-Type:   text/plain; charset=ISO-8859-1

Also, it's worth pointing out that the scope of the ranges may not be what one expects.

For example, a value like

4garbage

or

4.1

would map to 65 not 44. I think that's another reason to follow David's advice.

On Fri, 21 Apr 2006 14:06:51 -0700, David L Cassell <davidlcassell@MSN.COM> wrote:

>easwara@GMAIL.COM wrote: >>I'm facing a situtation where I need to apply Format on values which >>can be Alpha numeric! >> >>The below given format wrks fine for the Character values...and not for >>the numeric ranges!! I know this is a Stupid piece of code...but..is it >>possible in SAS to combine the character and numeric formats >>together,so that I can acheive the formats for the character as well as >>the numeric range?? >> >>or is there any other approach? probably a 'Select .... when' >>statement??? >> >>proc format; >>value $mx_dlnq >>'0'='77' >>'X'='65' >>'30 - 59'= '65' >>'60 - 89'= '49' >>'90 - High'= '33' >>other='54' >>; >>run; >> >>data _null_; >>r='33'; >>put r $mx_dlnq.; /* need to get 65 as the value in numeric range >>30-89! */ >>r='X'; >>put r $mx_dlnq.; >>run; > >I see that you got Toby to write (and re-write and re-re-write) code >for you. > >But I would like to know why you have data like this. > >It seems to me that you are doing the wrong thing with your data. >In your posiiton, I would try to convert to numeric, so the numbers >would be usable. Then I would take the 'character values' and assign >them as is appropriate, which is probably going to be as special missing >values. That's what they really are, right? > >Getting your data in the right form is going to be a lot easier than >fighting with the wrong form time and time again. > >HTH, >David >-- >David L. Cassell >mathematical statistician >Design Pathways >3115 NW Norwood Pl. >Corvallis OR 97330 > >_________________________________________________________________ >Don’t just search. Find. Check out the new MSN Search! >http://search.msn.click-url.com/go/onm00200636ave/direct/01/


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