Sorted list of words in string.
Syntax: @wsort(str_list[, “d”])
str_list: string
“d”: (optional) string literal
Return: string
Returns sorted elements of str_list. Use the “d” flag to sort in descending order.
Examples
@wsort("expr1 aa1 fr3")
returns the sorted string “aa1 expr1 fr3”
@wsort("fq8 Fq8 xpr1", "d")
sorts the string in descending order: “xpr1 Fq8 fq8”.
If ALPHA1 is an alpha series,
alpha a1 = @right(alpha1, 3)
returns the sorted string list values of ALPHA1 for each observation in the workfile sample.
If SVEC1 is an string vector,
svector s1 = @right(svec1, 2, "d")
returns an svector containing the descending order sorted string lists for each element of SVEC1.