Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Language Reference


LENGTH

The LENGTH function returns an integer equal to the length of the argument in national character positions for arguments of usage NATIONAL and in alphanumeric character positions or bytes for all other arguments. An alphanumeric character position and a byte are equivalent.

The type of the function is integer.

Read syntax diagramSkip visual syntax diagram
Format

>>-FUNCTION LENGTH--(--argument-1--)---------------------------><

argument-1
Can be:
  • An alphanumeric literal or a national literal
  • A data item of any class except DBCS
  • A data item described with usage POINTER, PROCEDURE-POINTER, FUNCTION-POINTER, or OBJECT REFERENCE
  • The ADDRESS OF special register
  • The LENGTH OF special register
  • The XML-NTEXT special register
  • The XML-TEXT special register

The returned value is a nine-digit integer determined as follows:


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)