REVERSE

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

Read syntax diagramSkip visual syntax diagram
>>-REVERSE(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 bit, character, graphic or widechar), according to the rules for concatenation.

Example

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

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





Published: 23 December 2018