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 (November 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 8 Nov 2005 18:55:42 +0530
Reply-To:     diwakar.d.sharma@US.HSBC.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Diwakar Sharma <diwakar.d.sharma@US.HSBC.COM>
Subject:      Re: data type conversion
Comments: To: Prakash eswaramoorthy <eprakash@AFSINDIA.COM>
Content-Type: text/plain; charset="US-ASCII"

Hi Prakash,

Use the zx. format for this conversion.

data test; input input; format output z3.; output=input; cards; -2 -1 0 1 120 run;

Obs input output

1 -2 -02 2 -1 -01 3 0 000 4 1 001 5 120 120

HTH,

Diwakar Sharma

|---------+-----------------------------------> | | Prakash eswaramoorthy| | | <eprakash@AFSINDIA.CO| | | M> | | | Sent by: "SAS(r) | | | Discussion" | | | <SAS-L@listserv.uga.e| | | du> | | | | | | | | | 11/08/05 06:42 PM | | | Please respond to | | | Prakash eswaramoorthy| | | | |---------+-----------------------------------> >--------------------------------------------------------------------------------------------------------------------------------------------------| | | | To: SAS-L@listserv.uga.edu | | cc: | | Subject: data type conversion | >--------------------------------------------------------------------------------------------------------------------------------------------------|

Hi, I have a problem which involves some numeric manipulation.For e.g if the number is -2 ,i want it to be dispalyed as -02,if the no is 2 it shud be 002 sample dataset is look like input output -2 -02 -1 -01 0 000 1 001 120 120

The problem is that the output should albe numeric datatype and not character.

I wud really appreciate if sumbody helps.

cheerz prakash,Easwaramoorthy

----------------------------------------- ****************************************************************** This message originated from the Internet. Its originator may or may not be who they claim to be and the information contained in the message and any attachments may or may not be accurate. ******************************************************************

----------------------------------------- *********************************************************************** This E-mail is confidential. It may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return E-mail.

Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions. ***********************************************************************


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