Functions and CALL Routines |
Reverses a character string.
Category: |
Character
|
Restriction: |
I18N Level 0
|
Tip: |
DBCS equivalent function is KREVERSE in
SAS National Language Support (NLS): Reference Guide.
|
-
argument
-
specifies a character constant, variable,
or expression.
In a DATA step, if the REVERSE function
returns a value to a variable that has not previously been assigned a length,
then that variable is given the length of the first argument.
The last character in the argument becomes the first character in the
result, the next-to-last character in the argument becomes the second character
in the result, and so on.
Note: Trailing blanks in the argument become
leading blanks in the result. ![[cautionend]](../../../../common/63294/HTML/default/images/cautend.gif)
SAS Statements |
Results |
|
----+----1
|
backward=reverse('xyz ');
put backward $5.;
|
zyx
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.