Transforming Data with SAS Functions | |
Modifying Character Values with
Functions![]() ![]() |
![]() |
SCAN versus SUBSTR
The SCAN function has similarities to the SUBSTR function. Let's briefly
compare the two. Both the SCAN and SUBSTR functions can extract a substring
from a character value:
The SUBSTR function is best used when you know the exact position
of the substring to extract from the character value. The substring
does not need to be marked by delimiters. For example, the first two
characters of the variable |
SAS Data
Name | ID |
Trentonson, Matthew Robert | SO45467 |
Truell, Marcia Elizabeth | SR32881 |
The SUBSTR function can extract this class-level information from ID .
However, the SCAN function is best used when
|
![]() ![]() ![]() ![]() ![]() ![]() |
|
![]() |
![]() |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.