Previous Topic Next topic Print topic


RANK Function

Purpose

Returns a fixed binary integer that is the position of the character x within the collating sequence.

Syntax

RANK(x)

Parameters

x is a character string of length one.

Description

The RANK function returns a fixed binary integer that is the position of the character x within the collating sequence.

The result is defined as RANK(x) = INDEX(COLLATE(),x)-1 and has an implementation-defined precision. For details on precisions, see your Open PL/I User's Guide.

The RANK function uses a 256-byte collating string.

Examples

DECLARE X FIXED BINARY(15);
X = RANK('2');   /* X IS SET TO 50 */

Restrictions

None.

Previous Topic Next topic Print topic