Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


REVERSE

The REVERSE function returns a character string of exactly the same length as the argument, whose characters are exactly the same as those specified in the argument except that they are in reverse order. For arguments of type national, character positions are reversed.

The function type depends on the type of the argument, as follows:

Argument type Function type
Alphabetic Alphanumeric
Alphanumeric Alphanumeric
National National

Format
Read syntax diagramSkip visual syntax diagram>>-FUNCTION REVERSE--(--argument-1--)--------------------------><
 
argument-1
Must be class alphabetic, alphanumeric, or national and must be at least one character in length.

The returned value is a character string of the same length as argument-1, with the characters of argument-1 in reversed order. For example, if argument-1 contains ABC, the returned value is CBA.


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)