Returns the maximum length of a string.
MAXLENGTH(x)
x is an expression that must have a computational type and should have a string type. Otherwise, it is converted to character.
The precision of the result is determined by the -bifprec compiler option.
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.