REVERSE

REVERSE returns a nonvarying string that contains the elements of x in reverse order.

Read syntax diagramSkip visual syntax diagramREVERSE( x)
x
Expression. x must have a computational type and should have a string type. If x does not have a string type, it is converted to string (that is, from numeric to character, bit, graphic, uchar, or widechar), according to the rules for concatenation.

Example

  dcl Source char value('HARPO');
  dcl Target char(length(Source));

  Target = reverse (Source);     /* 'OPRAH' */