Date: Wed, 14 Jul 2004 13:23:25 -0400
Reply-To: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Subject: Re: How to return integer/fractional value in SAS??
Content-Type: text/plain
Julie:
I find it surprising that no one recommended the MOD() function:
data test;
x=4.7;
/* integer part of x. */
y=int(x);
/* fractional part of unit in x. */
z=mod(x,1);
put x= y= z= ;
run;
Sig
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Julie
Sent: Monday, July 12, 2004 5:53 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: How to return integer/fractional value in SAS??
Simply looking for the way to return the integer or fractional part of a
given number? For example, in Excel, int() gives you the integer part for a
given number. If I have the number 4.7, How can I have the '4' or the '.7'
returned? Are there functions in SAS for this??
|