| Functions and CALL Routines |
| Category: | Character |
| Restriction: | I18N Level 0 |
| Tip: | DBCS equivalent function is KREVERSE in SAS National Language Support (NLS): Reference Guide. |
| Syntax | |
| Arguments | |
| Details | |
| Examples |
Syntax |
| REVERSE(argument) |
| Details |
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)
| Examples |
| SAS Statements | Results |
|---|---|
|
|
----+----1 |
backward=reverse('xyz '); put backward $5.; |
zyx |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.