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 ?
Content-Type: text/plain; charset=ISO-8859-1
Thank you ! This will also work.
On 10/14/09, Peter Flom <email@example.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 =(
>> & 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
> data today;
> input X @@;
> roundx = round(x);
> roundx2 = round(x,.1);
> 1.2092 29302.211
> proc print data = today;
> Peter L. Flom, PhD
> Statistical Consultant
> Website: www DOT peterflomconsulting DOT com
> Writing; http://www.associatedcontent.com/user/582880/peter_flom.html
> Twitter: @peterflom