I changed 'if index(word,letter) > 1 sorted = concat(sorted,letter)." to "if index(word,letter) >= 1 sorted = concat(sorted,letter).
" to make it work as what I want.
Thanks.
On Wed, Sep 18, 2013 at 3:11 PM, Ruben Geert van den Berg [via SPSSX Discussion] <[hidden email]> wrote:
Dear Albert,
Please try the syntax below.
data list free/word(a5).
begin data
abc
cba
dbace
ecabd
abcde
end data.
string sorted(a5).
do repeat letter = 'a','b','c','d','e'.
if index(word,letter) > 1 sorted = concat(sorted,letter).
end repeat.
exe.
HTH,
Ruben
If you reply to this email, your message will be added to the discussion below: