Returns a nonvarying string that contains the elements of an expression in reverse order.
REVERSE(x)
x should be a string type. It is converted to string if needed.
REVERSE returns a nonvaying string that contains the elements of an expression x in reverse order. x must have a computational type and a string type. If it does not have a string type, it is converted to string (that is, from numeric to bit or character), according to the rules for concatenation.
dcl s char (40) varying; s = 'NeverOddOrEven'; s = reverse(s); put skip list (s);
will print:
nevErOddOreveN
For structure expressions, only flat structures are allowed. Arrays, arrays of structures, and structure member arrays are not yet supported.