Previous Page | Next Page

Functions for NLS

KSCAN Function

Selects a specified word from a character expression.
Category: DBCS
Restriction: I18N Level 2
Tip: Non-DBCS equivalent function is SCAN in SAS Language Reference: Dictionary.



KSCAN(argument,n<, delimiters>)



specifies any character expression.


specifies a numeric expression that produces the number of the word in the character expression you want KSCAN to select.

Tip: If n is negative, KSCAN selects the word in the character expression starting from the end of the string. If |n| is greater than the number of words in the character expression, KSCAN returns a blank value.

specifies a character variable that produces characters that you want KSCAN to use as word separators in the character expression.

Default: If you omit delimiters in an ASCII environment, SAS uses the following characters:

blank . < ( + & ! $ * ) ; ^ - / , % |

In ASCII environments without the ^ character, KSCAN uses the ~ character instead.

If you omit delimiters on an EBCDIC environment, SAS uses the following characters:

blank . < ( + | & ! $ * ) ; ¬ - / , % | ¢

Tip: If you represent delimiters as a constant, enclose delimiters in quotation marks.


Leading delimiters before the first word in the character string do not effect KSCAN. If there are two or more contiguous delimiters, KSCAN treats them as one.

Previous Page | Next Page | Top of Page