KTRUNCATE Function

Truncates a string to a specified length in byte unit without breaking multibyte characters.
Category: DBCS

Syntax

KTRUNCATE(argument, number, length)

Required Arguments

argument
specifies any SAS character expression.
number
is numeric.
length
is an integer.

Details

See Internationalization Compatibility for SAS String Functions for restrictions and more information.
The KTRUNCATE function truncates a full-length number (stored as a double) to a smaller number of bytes, as specified in length and pads the truncated bytes with 0s. The truncation and subsequent expansion duplicate the effect of storing numbers in less than full length and then reading them.