LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (October 1999, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 14 Oct 1999 11:31:15 -0400
Reply-To:   Y.Huang@ORGANONINC.COM
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Ya Huang <Y.Huang@ORGANONINC.COM>
Subject:   Re: Simple (I think) Truncating Question
Comments:   To: cjs46692@GLAXOWELLCOME.COM
Content-type:   multipart/alternative;

You are right, it dosen't seem to work using either width= or format, if you don't mind using compute block, here are some codes may be helpful:

DATA XX; DO I=1 TO 5; X=UNIFORM(I*100)*10; OUTPUT; END;

proc print;

PROC report; COLUMN i x truncx; define i / group width=5; define x / noprint; define truncx / 'x' width=6; compute truncx; truncx=int(_c2_*100)/100; /* for 2 decimal place */ endcomp; RUN;

==========

1 The SAS System 1 11:14 Thursday, October 14, 1999

OBS I X

1 1 4.96257 2 2 0.08872 3 3 9.82431 4 4 9.39865 5 5 1.60258 1 The SAS System 2 11:14 Thursday, October 14, 1999

I x 1 4.96 2 0.08 3 9.82 4 9.39 5 1.6

If you don't want to touch the code of proc report, you can do the same thing in a data step, right before proc report:

data xx (rename=(truncx=x)); set xx; truncx=int(x*100)/100; drop x;

Regards,

Ya

-----Original Message----- From: cjs46692 [mailto:cjs46692@GLAXOWELLCOME.COM] Sent: Thursday, October 14, 1999 10:10 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Simple (I think) Truncating Question

I have a program that has several tables generated by proc report. There are no calculations involved, it only prints results. The problem is, I want to display the results as truncated numbers with 2 or 3 decimal places. It seems everything I try rounds the number (format, etc). Any help would be appreciated. Thanks! Carol


[text/html]


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