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 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 26 May 2006 02:32:05 -0400
Reply-To:     Jim Groeneveld <jim2stat@YAHOO.CO.UK>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jim Groeneveld <jim2stat@YAHOO.CO.UK>
Subject:      Re: converting numeric to char
Comments: To: Mohit Bhatia <mohit.b.bhatia@AEXP.COM>
Content-Type: text/plain; charset=ISO-8859-1

Hi Mohit,

What numeric value would you want to convert? How large is the value? What should the character value look like? And what is the character value you get? Your problem stating is incomplete without those details.

However, I can guess a little bit on that. You specify a format of [12.]. So you want 12 digits. A new character variable has a default length of 8 bytes (characters) (well, unless created by a SAS function). You have to pre-specify the longer length: LENGTH NewVar $12;

Regards - Jim. -- Jim Groeneveld, Netherlands Statistician, SAS consultant

On Fri, 26 May 2006 11:52:30 +0530, Mohit Bhatia <mohit.b.bhatia@AEXP.COM> wrote:

>Hi, >I am doing this to convert numeric to character variable. >data temp; >length acct15 $15.; >set temp; >newvar=put(oldvar,12.); >run > >when i take a print its not giving me the desired output.Kindly help >American Express made the following > annotations on 05/25/06, 23:22:40 >------------------------------------------------------------------------------ >****************************************************************************** > >"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you." > >American Express a ajouté le commentaire suivant le 05/25/06, 23:22:40 > >Ce courrier et toute pièce jointe qu'il contient sont réservés au seul destinataire indiqué et peuvent renfermer des renseignements confidentiels et privilégiés. Si vous n'êtes pas le destinataire prévu, toute divulgation, duplication, utilisation ou distribution du courrier ou de toute pièce jointe est interdite. Si vous avez reçu cette communication par erreur, veuillez nous en aviser par courrier et détruire immédiatement le courrier et les pièces jointes. Merci. >****************************************************************************** > =============================================================================

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