Chapter 6

Truncation Functions

 

Introduction

Functions That Round and Truncate Numerical Values

CEIL

FLOOR

INT

ROUND

Function That Returns SAS Numerical Values Stored in Fewer than 8 Bytes

TRUNC

 

Introduction

This chapter covers five functions that involve rounding or truncation. TRUNC allows you to perform logical comparisons on numerical values that were stored with fewer than 8 bytes. There is also a novel use of the ROUND function to place values into groups, such as an age group.

There is a group of functions (CEILZ, FLOORZ, INTZ, and ROUNDZ) similar to the ones in this chapter, except that they do not ”fuzz” the result. Fuzzing the result means to return an integer value if the result is within 10−12 of an integer.

 

Functions ...

Get SAS Functions by Example, Second Edition, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.