O'Reilly logo

SAS Functions by Example, Second Edition, 2nd Edition by Ron Cody

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 That ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required