One of the possible solutions:
Data test2; set test1; count=0; pos=0; do until(word=''); pos+1; word=scan(abc,pos); if word^='' then count+1; end; drop pos word; Run;
Thanks! Akshaya