Syntax, CEIL and FLOOR
function:
CEIL(argument)
FLOOR(argument)
|
SAS Statement
|
Result
|
---|---|
CEIL Function Examples
|
|
data _null_; var1=2.1; var2=-2.1; a=ceil(var1); b=ceil(var2); put "a=" a; put "b=" b; run; |
a=3 b=-2 |
data _null_; c=ceil(1+1.e-11); d=ceil(-1+1e-11); e=ceil(1+1.e-13) put "c=" c; put "d=" d; put "e=" e; run; |
c=2 d=0 e=1 |
data _null_; f=ceil(223.456); g=ceil(763); h=ceil(-223.456); put "f=" f; put "g=" g; put "h=" h; run; |
f=224 g=763 h=-223 |
FLOOR Function Examples
|
|
data _null_; var1=2.1; var2=-2.1; a=floor(var1); b=floor(var2); put "a=" a; put "b=" b; run; |
a=2 b=-3 |
data _null_; c=floor(1+1.e-11); d=floor(-1+1e-11); e=floor(1+1.e-13) put "c=" c; put "d=" d; put "e=" e; run; |
c=1 d=-1 e=1 |
data _null_; f=floor(223.456); g=floor(763); h=floor(-223.456); put "f=" f; put "g=" g; put "h=" h; run; |
f=223 g=763 h=-224 |
Syntax, INT function:
INT(argument)
|
data work.creditx; set cert.credit; Transaction=int(transaction); run; proc print data=work.creditx; run;
Syntax, ROUND function:
ROUND(argument,round-off-unit)
|
data work.rounders; set cert.rounders; AccountBalance=round(AccountBalance, 1); InvoicedAmount=round(InvoicedAmount, 0.1); AmountRemaining=round(AmountRemaining, 0.02); format AccountBalance InvoicedAmount PaymentReceived AmountRemaining dollar9.2; run; proc print data=work.rounders; run;