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 (August 1999, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 23 Aug 1999 13:29:08 -0400
Reply-To:     Rob Carscadden <rcarscadden@METISAMERICA.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Comments:     To: nicholas_m_spanos/dsd/hq/boc_at_boc@CCMAIL.CENSUS.GOV
From:         Rob Carscadden <rcarscadden@METISAMERICA.COM>
Subject:      Re: SAS Function
Comments: To: SAS-L@LISTSERV.VT.EDU
In-Reply-To:  <9908239354.AA935427233@smtp-gw1.census.gov>
Content-Type: text/plain; charset="us-ascii"

SAS has two formats that translate numbers into words, the wordf and words, you can combine these with a put statement and you're good to go.

data test; length myword1 myword2 $200;

mynum = 12; myword1 = put(mynum,wordf200.); myword2 = put(mynum,words200.); output;

mynum = 12.5; myword1 = put(mynum,wordf200.); myword2 = put(mynum,words200.); output;

mynum = -12000.25; myword1 = put(mynum,wordf200.); myword2 = put(mynum,words200.); output;

mynum = 1001.9; myword1 = put(mynum,wordf200.); myword2 = put(mynum,words200.); output; mynum = .; myword1 = put(mynum,wordf200.); myword2 = put(mynum,words200.); output; run; proc print; run; **************** gives this output:

OBS MYWORD1 MYWORD2 MYNUM

1 twelve and 00/100 twelve 12.00 2 twelve and 50/100 twelve and fifty hundredths 12.50 3 minus twelve thousand and 25/100 minus twelve thousand and twenty-five hundredths -12000.25 4 one thousand one and 90/100 one thousand one and ninety hundredths 1001.90 5 missing missing .

At 12:48 PM 08/23/1999 -0400, nicholas_m_spanos/dsd/hq/boc_at_boc@CCMAIL.CENSUS.GOV wrote: > Does SAS have a function that translates a number into works? > (ie. 1001 > One thousand and one...) > > Thanks, > > Nick Spanos >

Rob Carscadden Metis/America rcarscadden@metisamerica.com 5310 Markel Road, Suite 202 Richmond, VA 23230 voice: (804) 285-3264 fax: (804) 285-2059


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