KLENGTH Function

Returns the length of an argument.
Category: DBCS
Tip: Non-DBCS equivalent function is LENGTH in SAS Functions and CALL Routines: Reference.

Syntax

KLENGTH(argument)

Required Argument

argument
specifies any SAS expression.

Details

See Internationalization Compatibility for SAS String Functions for restrictions and more information.
The KLENGTH function returns an integer that represents the position of the rightmost non-blank character in the argument. If the value of the argument is missing, KLENGTH returns a value of 1. If the argument is an uninitialized numeric variable, KLENGTH returns a value of 12 and prints a note in the SAS log that the numeric values have been converted to character values.