DCOUNT() |
![]() ![]() ![]() |
The DCOUNT() function counts delimited substrings within a string.
Format
DCOUNT(string, delimiter)
where
The DCOUNT() function counts substrings delimited by delimiter within string. Substrings may not overlap, thus
S = "ABABABABABABA" N = DCOUNT(S, "BAB")
sets N to 4.
If string is null, DCOUNT() returns zero. In all other cases, DCOUNT() returns a value one greater than the COUNT() function applied to the same string.
If substring is null, DCOUNT() returns the length of string.
Programs compiled with the $NOCASE.STRINGS compiler directive use case insensitive string comparisons in the DCOUNT() function.
Example
FIELDS = DCOUNT(REC, @FM)
This statement counts the fields in REC.
See also: |