RANK Function

Returns the position of a character in the ASCII or EBCDIC collating sequence.

Category: Character
Restriction: I18N Level 0 functions are designed for use with Single Byte Character Sets (SBCS) only.
See: RANK Function: Windows in SAS Companion for Windows
RANK Function: UNIX in SAS Companion for UNIX Environments

Syntax

RANK(x)

Required Argument

x

specifies a character constant, variable, or expression.

Details

The RANK function returns an integer that represents the position of the first character in the character expression. The result depends on your operating environment.

Example

The following SAS statements produce these results.
SAS Statement
Result
ASCII
EBCDIC
n=rank('A');
put n;
 
65
 
193

See Also