OCCURS( ) function

Returns a count of the number of times a substring occurs in a specified character string.

Syntax

OCCURS(string, search_for)

Parameters

string

Character. The value to search in.

search_for

Character. The character string to search for.

Output

Numeric.

Remarks

This function compares the value of the search_for parameter to the string parameter on a character-by-character basis, and returns the number of times the search_for parameter is found in string.

The function is case-sensitive, and both parameters must be enclosed in quotes. When it looks for occurrences of the search_for parameter in the string parameter the letter case must match. For example, “Portland” is not equivalent to “PORTLAND”. If you are working with data that includes inconsistent letter casing, you can use the UPPER( ) or LOWER( ) functions to convert values to consistent casing before using the OCCURS( ) function.

Examples

Example Return value

OCCURS("abc/abc/a","ab")

2

OCCURS("abc/abc/a","a")

3



(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback