Returns the maximum length of a string. The result precision is Fixed Binary(15).
MAXLENGTH(x)
x is an expression that must have a computational type and should have a string type. Otherwise, it is converted to character.
dcl s char (40) varying; dcl t char (40) ; s = 'The Lawn, 22-30 Old Bath Road'; put skip list ('maxlength(s) is: ', maxlength(s)); /* char var */ put skip list ('maxlength(t) is: ', maxlength(t)); /* char */
will print:
maxlength(s) is: 40 maxlength(t) is: 40
None.