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 1996, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 15 Aug 1996 08:05:00 -0400
Reply-To:     liu.w@PG.COM
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         liu.w@PG.COM
Subject:      Re[2]: simple (I hope) question re. numeric - char. co
Comments: To: simon@hudson.u-net.com

Simon,

It is in the SAS manuals. You'll find it in SAS Language v6, 1st edition, Chpt. 4 under Numeric-Character Conversion. The example you gave is an automatic conversion that does the job 'quick and dirty', while the input function as many others who responded earlier on the 'L gives more sophiscated (may I say that?) and versatile way of doing it.

Wangyue Liu

______________________________ Reply Separator _________________________________ Subject: Re: simple (I hope) question re. numeric - char. co Author: (INTERNET)simon@hudson.u-net.com at external Date: 8/15/96 4:15 AM

rcs8@psu.edu (Roger C. Shouse) wrote:

>I have a numeric variable, call it A, that I wish to convert to a character >variable, say B. I've read the big SAS book (the "book o' fun, I call it), >and cannot find a simple *effective* way to do this. Now I know I could make >a new data file then infile the variable back in as character, but this would >be very time consuming for me.

>Please help!

>Roger Shouse >Asst. Prof. >Penn State

I struggled to find the answer to this a couple of months ago. It probably isn't in the manuals because you don;t really need to 'do' anything. If you assign the value in variable A (numeric) to variable B (character) SAS performs the conversion for you

e.g. Length B $5; A=23456; B=A;

then B becomes '23456' as a character variable.

------ Simon Hudson, Sema Group Outsourcing, Liverpool, UK simon@hudson.u-net.com 100651.1524@compuserve.com


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