|
in addition: the round function is very flexible! You can use any number as
second argument. E.g you might want to round a DATETIME value (seconds) to
hours, you can use round(datetime,60*60), to days: ....,60*60*24, ... or
even to half-hours: ....,60*30). Also you can write that more readable:
rounded=round(datetime,"00:30"t);
That is very useful for something like MERGEing or for comparing, ...
On Thu, 29 Jul 2004 14:06:07 -0700, David Fickbohm <DavidF@HOMEGAIN.COM>
wrote:
>Sharon,
>One way would be to use the round function.
>
>data bbb;
> set aaa;
> rounded_result = round(unrounded_original,1);
>run;
>Then use the rounded_result in your proc print. If you are trying to round
>a number past the decimal place then you need to include the decimal place
>in the round off unit in the function, ie. unrounded_original is 10.65
>and you want 10.7 then use
>rounded_result = round(unrounded_original,.1);
>
>Good luck,
>hope this helps
>Dave
>
>-----Original Message-----
>From: Sharon [mailto:findingjobs@HOTMAIL.COM]
>Sent: Thursday, July 29, 2004 1:41 PM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: Rounding
>
>
>I'd like SAS to round my variables to the nearest integer.
>I read in the SAS help that the statment "proc print round (X, 1)" can
>round the numbers. However, I get an error message when I do this.
>I also tried using "proc means maxdec = 1" but this also does not do
>anything.
>Can anyone help me?
>Thank you.
|