Searches a character expression for a string of characters, and returns the position of the string's first character for the first occurrence of the string.
Category: | Character |
Restriction: | I18N Level 0 functions are designed for use with Single Byte Character Sets (SBCS) only. |
Tip: | DBCS equivalent function is KINDEX in SAS National Language Support (NLS): Reference Guide. See DBCS Compatibility . |
specifies a character constant, variable, or expression to search.
is a character constant, variable, or expression that specifies the string of characters to search for in source.
Tips | Enclose a literal string of characters in quotation marks. |
Both leading and trailing spaces are considered part of the excerpt argument. To remove trailing spaces, include the TRIM function with the excerpt variable inside the INDEX function. |
index('ABC,DE F(X=Y)',' ') => 0 kindex('ABC,DE F(X=Y)',' ') => 7