Date: Tue, 11 Nov 2003 11:24:35 +0100
Reply-To: Jan Selchau-Hansen <jan@*SELCHAU-HANSEN.DK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jan Selchau-Hansen <jan@*SELCHAU-HANSEN.DK>
Organization: TDC Totalloesninger
Subject: Re: Formatting the output from a numeric macrovariable
"Rune Runnestoe" <rune@fastlane.no> skrev i en meddelelse
news:24410121.0311110204.13434e7d@posting.google.com...
> %let num_1=33;
> %let num_2=295;
> %let pst_kont = %sysevalf(100/&num_1*&num_2);
> %put &pst_kont;
>
> &pst_kont evaluates to 893.939393939393, and I want it to evaluate to
> 894. Without any digits behind the decimal point.
> How do I format a macro variable like pst_kont ?
>
> Regards
> Rune Runnestoe
Use round & sysfunc, like this :
%let num_1=33;
%let num_2=295;
%let pst_kont = %sysfunc(round(%sysevalf(100/&num_1*&num_2)));
%put &pst_kont;
|