GET_TOKEN: Extracting a Token Based on a String of Delimiters

How to:

GET_TOKEN extracts a token (substring) based on a string that can contain multiple characters, each of which represents a single-character delimiter.

Syntax: How to Extract a Token Based on a String of Delimiters

GET_TOKEN(string, delimiter_string, occurrence)

where:

string

Alphanumeric

Is the input string from which the token will be extracted. This can be an alphanumeric field or constant.

delimiter_string

Alphanumeric constant

Is a string that contains the list of delimiter characters. For example, '; ,' contains three delimiter characters, semi-colon, blank space, and comma.

occurrence

Integer constant

Is a positive integer that specifies the token to be extracted. A negative integer will be accepted in the syntax, but will not extract a token. The value zero (0) is not supported.

Example: Extracting a Token Based on a String of Delimiters

GET_TOKEN extracts a token based on a string of delimiters.

GET_TOKEN(InputString, ',;/', 4)

For input string 'ABC,DEF;GHI/JKL', the result is JKL.

WebFOCUS

Feedback