LEN(STRING)

Purpose

Returns the length of a character entity. The argument to this function need not be defined.

Class

Inquiry function

Argument Type and Attributes

STRING
must be of type character. It may be scalar or array valued.

Result Type and Attributes

Default integer scalar.

Result Value

The result has a value equal to the number of characters in STRING if it is scalar or in an element of STRING if it is array valued.

Examples

If C is declared by the statement

 CHARACTER (11) C(100)

LEN (C) has the value 11.


Specific Name Argument Type Result Type Pass As Arg?
LEN default character default integer yes (1)

Notes:

  1. IBM Extension: the ability to pass the name as an argument.
IBM Copyright 2003