The length function returns the length (number of characters) of a string value.
Syntax:
►►─┬─ SLEN ──────────┬─ (string) ─────────────────────────────────────────────►◄ ├─ SLENGTH ───────┤ └─ STRING-LENGTH ─┘
Invocation names:
SLEN SLENGTH STRING-LENGTH
Parameters:
Specifies the string value whose length is determined.
To calculate the length of a string value, excluding leading and trailing spaces, use the length function in conjunction with the extract function.
Example:
This example determines the length of a name contained in EMP-FIRST-NAME-0415 (PIC X(10)). The value of EMP-FIRST-NAME is 'ELMER '.
select slength(extract(emp-first-name-0415)) from employee 'ELMER' 5
|
Copyright © 2013 CA.
All rights reserved.
|
|