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 (October 2009, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 14 Oct 2009 11:02:25 -0400
Reply-To:     sudip chatterjee <sudip.memphis@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         sudip chatterjee <sudip.memphis@GMAIL.COM>
Subject:      Re: MAXDEC option in datastep ?
Comments: To: Peter Flom <peterflomconsulting@mindspring.com>
In-Reply-To:  <18465108.1255532248094.JavaMail.root@elwamui-hound.atl.sa.earthlink.net>
Content-Type: text/plain; charset=ISO-8859-1

Peter,

Thank you ! This will also work.

On 10/14/09, Peter Flom <peterflomconsulting@mindspring.com> wrote: > sudip chatterjee <sudip.memphis@GMAIL.COM> wrote >> >> I know I can use the maxdec option to reduce the decimal number in >>proc means, I was wondering is there anything like maxdec which I can >>use in datastep ? >> >> I have a simple dataset with X and Y variables, I have created a Z =( >> X/Y)*100 >> >> & I see Z has values like 12.28976654321 or 32.22117766550 >> >> How can I reduce this in 1 decimal place like 12.3 and 32.2 >> >> I know 1 step, that is, export the file to excel change the decimal >>number and then again import back the file to sas. I am not happy with >>this step, any suggestions will be appreciated. >> >> Thank you for all your time and support. >> > > I don't necessarily recommend this ... I think you want to keep the full > expansion of the data, but .... if you really need to do this, then ROUND > works > > data today; > input X @@; > roundx = round(x); > roundx2 = round(x,.1); > datalines; > 1.2092 29302.211 > ; > run; > proc print data = today; > run; > > > HTH > > Peter > > > > Peter L. Flom, PhD > Statistical Consultant > Website: www DOT peterflomconsulting DOT com > Writing; http://www.associatedcontent.com/user/582880/peter_flom.html > Twitter: @peterflom >


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