Command Reference : String and Date Function Reference
Number of word elements.
Syntax: @wcount(str_list)
str_list: string
Return: integer
Returns the number of word elements in the string list.
The commands
string s1 = "I did not do it"
@wcount("I did not do it")
return the number 5.
If ALPHA1 is an alpha series,
scalar alphalwr = @wcount(alpha1)
returns the number of words in the strings in ALPHA1 for each observation in the workfile sample.
If SVEC1 is an string vector,
vector sveclen = @wcount(svec1)
returns a the number of elements in each of the strings in SVEC1.
See also @len for the length of the strings.