| Macro Functions for NLS |
| Category: | DBCS |
| Type: | NLS macro function |
| Syntax | |
| Details | |
| Example | |
| Locating a Character | |
Syntax |
| %KINDEX (source, string) |
is a character string or text expression.
is a character string or text expression.
| Details |
The %KINDEX function searches source for the first occurrence of string and returns the position of its first character. If string is not found, the function returns 0.
| Example |
The following statements find the first character V in a string:
%let a=a very long value; %let b=%kindex(&a,v); %put V appears at position &b..;
When these statements execute, the following line is written to the SAS log:
V appears at position 3.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.