LENV: Returning the Length of an Alphanumeric Field

How to:

The LENV function returns the actual length of an AnV input field or the size of an An field.


Top of page

x
Syntax: How to Return the Length of an Alphanumeric Field
LENV(source_string, output_format) 

where:

source_string

Alphanumeric of type An or AnV.

If it is an An format field, the function returns its size n. For a character string enclosed in quotation marks or a variable, the size of the string or variable is returned. For a field of AnV format, its length, taken from the length-in-bytes of the field, is returned.

output_format

Integer



Example: Finding the Length of an AnV Field

LENV returns the length of TITLEV and stores the result in a column with the format I2:

LENV(TITLEV, 'I2')

For ALICE IN WONDERLAND, the result is 19.

For SLEEPING BEAUTY, the result is 15.


iWay Software