KINDEX Function

Searches a character expression for a string of characters.
Category: DBCS
Tip: Non-DBCS equivalent function is INDEX in SAS Functions and CALL Routines: Reference

Syntax

KINDEX(source, excerpt)

Required Arguments

source
specifies the character expression to search.
excerpt
specifies the string of characters to search for in the character expression.
Tip:Enclose a literal string of characters in quotation marks.

Details

See Internationalization Compatibility for SAS String Functions for restrictions and more information.
The KINDEX function searches source, from left to right, for the first occurrence of the string that is specified in excerpt, and returns the position in source of the string's first character. If the string is not found in source, KINDEX returns a value of 0. If there are multiple occurrences of the string, KINDEX returns only the position of the first occurrence.

See Also

Functions: